Color image processing method and device

The color image processing method addresses the issue of incomplete interpolation in RGBW arrays by using horizontal and vertical white pixel interpolation and color difference uniformity parameters to enhance image quality and reduce pseudo colors.

CN113920034BActive Publication Date: 2024-12-27BRIGATES MICROELECTRONICS (KUNSHAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111399034.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-19
Publication Date
2024-12-27
Estimated Expiration
2041-11-19

AI Technical Summary

Technical Problem

Existing color image processing methods using RGBW pixel arrays result in poor quality RGB color images due to incomplete interpolation of white pixels, leading to increased pseudo colors and reduced accuracy.

Method used

A color image processing method that performs horizontal and vertical interpolation using white pixels on either side of color pixels, followed by obtaining color difference uniformity parameters to select the most accurate interpolation direction, thereby forming a high-quality color image.

Benefits of technology

The method reduces pseudo colors and improves the quality of demosaiced color images by utilizing both horizontal and vertical interpolation directions based on color difference uniformity parameters, ensuring accurate pixel selection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113920034B_ABST
    Figure CN113920034B_ABST
Patent Text Reader

Abstract

A color image processing method and device thereof, wherein the method comprises: obtaining a mosaic image to be processed; obtaining a horizontal white pixel interpolation image and a vertical white pixel interpolation image; obtaining a horizontal demosaiced color image according to the horizontal white pixel interpolation image and the mosaic image to be processed; obtaining a vertical demosaiced color image according to the vertical white pixel interpolation image and the mosaic image to be processed; obtaining a horizontal color difference uniformity parameter and a vertical color difference uniformity parameter of each pixel position according to the horizontal demosaiced color image and the vertical demosaiced color image; according to the size relationship between the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter, obtaining a pixel at each pixel position in the horizontal demosaiced color image or the vertical demosaiced color image to form a color image. Thus, the pseudo color of the color image after demosaicing is reduced and the quality of the color image 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 color image processing method and a device thereof. Background Art

[0002] White pixels have a wider spectral response than color pixels and can receive more photons. Therefore, security monitoring equipment and other equipment that need to work at night, in order to see the target clearly in low-light environments, mostly use black-and-white image sensors composed of white pixels (hereinafter referred to as W pixels).

[0003] Since color images contain more information than black and white images, it is of great practical significance to enable color image sensors to capture high-quality color images under low illumination. In order to improve the image quality of color images under low illumination, the prior art adds 50% W pixels to RGB color image sensors to form an RGBW pixel array, which improves the image quality under low illumination to a certain extent.

[0004] Specifically, a de-mosaicing image processing method is proposed in the prior art, which first interpolates a complete W pixel channel through 50% of the W pixels, and then calculates the RGB pixels using the ratio of the RGB pixels to the low-frequency components of the W pixels to form an RGB color image.

[0005] However, when forming an RGB color image by interpolating W pixels, only 50% of the information of W pixels is interpolated, resulting in poor accuracy of W pixel interpolation, causing the RGB color image after demosaicing to still have more pseudo colors and poor quality of the RGB color image. Summary of the invention

[0006] The technical problem solved by the present invention is to provide a color image processing method and a device thereof, so as to reduce the pseudo color of the color image after demosaicing and improve the quality of the color image after demosaicing.

[0007] In order to solve the above technical problems, the technical solution of the present invention provides a color image processing method, comprising: obtaining a mosaic image to be processed, wherein the mosaic image to be processed includes a plurality of initial white pixels and a plurality of initial color pixels arranged in a two-dimensional array at a plurality of pixel positions, and the initial white pixels and the initial color pixels are arranged alternately in the horizontal direction and the vertical direction; performing a first interpolation process on the pixel position where each initial color pixel is located according to the initial white pixels on both sides of each initial color pixel along the horizontal direction to obtain a horizontal white pixel interpolation image; obtaining a horizontal demosaiced color image according to the horizontal white pixel interpolation image and the mosaic image to be processed; and performing a first interpolation process on the pixel position where each initial color pixel is located according to the initial white pixels on both sides of each initial color pixel along the horizontal direction to obtain a horizontal white pixel interpolation image. The invention relates to a method for obtaining a vertical white pixel interpolation image by performing a second interpolation process on the pixel position where each initial color pixel is located, and obtaining a vertical white pixel interpolation image; obtaining a vertical demosaiced color image according to the vertical white pixel interpolation image and the mosaic image to be processed; obtaining a horizontal color difference uniformity parameter and a vertical color difference uniformity parameter of each pixel position according to the horizontal demosaiced color image and the vertical demosaiced color image; and obtaining a pixel at each pixel position in the horizontal demosaiced color image or the vertical demosaiced color image according to the size relationship between the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position to form a color image.

[0008] Optionally, the multiple initial color pixels include multiple initial red pixels, multiple initial green pixels and multiple initial blue pixels, and before performing the first interpolation processing and the second interpolation processing, the color image processing method also includes: performing pixel value uniformity processing on the mosaic image to be processed to obtain an adjusted mosaic image, wherein the adjusted mosaic image includes multiple adjusted red pixels, multiple adjusted green pixels, multiple adjusted blue pixels and multiple adjusted white pixels with equal average pixel values.

[0009] Optionally, the method for performing pixel value uniformity processing on the mosaic image to be processed includes: obtaining an average pixel value of the multiple initial red pixels; obtaining an average pixel value of the multiple initial green pixels; obtaining an average pixel value of the multiple initial blue pixels; obtaining an average pixel value of the multiple initial white pixels; obtaining a first adjustment coefficient, a second adjustment coefficient, a third adjustment coefficient and a fourth adjustment coefficient according to the average pixel value of the multiple initial red pixels, the average pixel value of the multiple initial green pixels, the average pixel value of the multiple initial blue pixels, and the average pixel value of the multiple initial white pixels; adjusting the pixel value of each initial red pixel according to the first adjustment coefficient to form a corresponding adjusted red pixel; adjusting the pixel value of each initial green pixel according to the second adjustment coefficient to form a corresponding adjusted green pixel; adjusting the pixel value of each initial blue pixel according to the third adjustment coefficient to form a corresponding adjusted blue pixel; adjusting the pixel value of each initial white pixel according to the fourth adjustment coefficient to form a corresponding adjusted white pixel; the average pixel value of the multiple adjusted red pixels, the average pixel value of the multiple adjusted green pixels, the average pixel value of the multiple adjusted blue pixels, and the average pixel value of the multiple adjusted white pixels are equal.

[0010] Optionally, at least one of the first adjustment coefficient, the second adjustment coefficient, the third adjustment coefficient and the fourth adjustment coefficient is 1.

[0011] Optionally, the pixels at each pixel position of the color image include red pixels, green pixels and blue pixels; the color image processing method also includes: performing restoration processing on the color image to form a restored color image, and the restoration processing includes: adjusting each red pixel of the color image according to a first adjustment coefficient to form a corresponding restored red pixel; adjusting each green pixel of the color image according to a second adjustment coefficient to form a corresponding restored green pixel; adjusting each blue pixel of the color image according to a third adjustment coefficient to form a corresponding restored blue pixel.

[0012] Optionally, the color image also includes white pixels at each pixel position; and the restoration process further includes: adjusting each white pixel of the color image according to a fourth adjustment coefficient to form a corresponding restored white pixel.

[0013] Optionally, the first interpolation process includes: according to the horizontal direction, i The pixel values ​​W1 of the two adjusted white pixels corresponding to the two adjacent initial white pixels i and pixel value W2 i , obtain the initial color pixel C i The horizontal white pixel interpolation Wh at the pixel position i =(W1i +W2 i ) / 2; with the initial color pixel C i The horizontal white pixel interpolation Wh at the pixel position i , interpolate to the same pixel position in the adjusted mosaic image.

[0014] Optionally, the second interpolation process includes: according to the vertical direction, i The pixel values ​​of the two adjusted white pixels corresponding to the two adjacent initial white pixels are W3 i and pixel value W4 i , obtain the initial color pixel C i The vertical white pixel interpolation Wv at the pixel position i =(W3 i +W4 i ) / 2; with the initial color pixel C i The vertical white pixel interpolation Wv at the pixel position i , interpolate to the same pixel position in the adjusted mosaic image.

[0015] Optionally, the method for obtaining a horizontal demosaiced color image according to a horizontal white pixel interpolation image and a mosaic image to be processed includes: performing pixel value subtraction processing on the adjusted mosaic image and the horizontal white pixel interpolation image at each pixel position to obtain a horizontal slowly varying mosaic image, wherein the horizontal slowly varying mosaic image includes a plurality of horizontal slowly varying red pixels, a plurality of horizontal slowly varying green pixels, and a plurality of horizontal slowly varying blue pixels; performing a third interpolation processing on the horizontal slowly varying mosaic image according to the plurality of horizontal slowly varying red pixels to obtain a horizontal slowly varying red pixel channel image, wherein each pixel position of the horizontal slowly varying red pixel channel image has one initial horizontal red pixel; performing a pixel value addition processing on the horizontal white pixel interpolation image and the horizontal slowly varying red pixel channel image according to the plurality of horizontal slowly varying green pixels to obtain a horizontal slowly varying red pixel channel image; performing a third interpolation processing on the horizontal slowly varying mosaic image according to the plurality of horizontal slowly varying green pixels to obtain a horizontal slowly varying red pixel channel image; The image is subjected to a fourth interpolation process to obtain a horizontal slowly varying green pixel channel image, wherein each pixel position of the horizontal slowly varying green pixel channel image has one initial horizontal green pixel; the horizontal white pixel interpolation image and the horizontal slowly varying blue pixel channel image are subjected to a pixel-by-pixel addition process to obtain a horizontal blue pixel channel image; according to the multiple horizontal slowly varying blue pixels, the horizontal slowly varying mosaic image is subjected to a fifth interpolation process to obtain a horizontal slowly varying blue pixel channel image, wherein each pixel position of the horizontal slowly varying blue pixel channel image has one initial horizontal blue pixel; the horizontal white pixel interpolation image and the horizontal slowly varying blue pixel channel image are subjected to a pixel-by-pixel addition process to obtain a horizontal blue pixel channel image; and the horizontal red pixel channel image, the horizontal green pixel channel image and the horizontal blue pixel channel image are combined to form a horizontal demosaiced color image.

[0016] Optionally, the method for obtaining a horizontal demosaiced color image further includes: merging the horizontal red pixel channel image, the horizontal green pixel channel image, the horizontal blue pixel channel image and the horizontal white pixel interpolation image to form the horizontal demosaiced color image.

[0017] Optionally, the method for obtaining a vertical demosaiced color image according to the vertical white pixel interpolation image and the mosaic image to be processed includes: performing pixel value subtraction processing on the adjusted mosaic image and the vertical white pixel interpolation image at each pixel position to obtain a vertical slowly varying mosaic image, wherein the vertical slowly varying mosaic image includes a plurality of vertical slowly varying red pixels, a plurality of vertical slowly varying green pixels, and a plurality of vertical slowly varying blue pixels; performing a sixth interpolation processing on the vertical slowly varying mosaic image according to the plurality of vertical slowly varying red pixels to obtain a vertical slowly varying red pixel channel image, wherein each pixel position of the vertical slowly varying red pixel channel image has one initial vertical red pixel; performing a pixel value addition processing on the vertical white pixel interpolation image and the vertical slowly varying red pixel channel image according to the plurality of vertical slowly varying green pixels to obtain a vertical red pixel channel image; performing a sixth interpolation processing on the vertical slowly varying mosaic image according to the plurality of vertical slowly varying green pixels to obtain a vertical slowly varying red pixel channel image; The image is subjected to a seventh interpolation process to obtain a vertical slowly varying green pixel channel image, wherein each pixel position of the vertical slowly varying green pixel channel image has one initial vertical green pixel; the vertical white pixel interpolation image and the vertical slowly varying green pixel channel image are subjected to a pixel-by-pixel addition process to obtain a vertical green pixel channel image; the vertical slowly varying mosaic image is subjected to an eighth interpolation process according to the plurality of vertical slowly varying blue pixels to obtain a vertical slowly varying blue pixel channel image, wherein each pixel position of the vertical slowly varying blue pixel channel image has one initial vertical blue pixel; the vertical white pixel interpolation image and the vertical slowly varying blue pixel channel image are subjected to a pixel-by-pixel addition process to obtain a vertical blue pixel channel image; and the vertical red pixel channel image, the vertical green pixel channel image and the vertical blue pixel channel image are combined to form the vertical demosaiced color image.

[0018] Optionally, the method for obtaining a vertical demosaiced color image further includes: merging the vertical red pixel channel image, the vertical green pixel channel image, the vertical blue pixel channel image and the vertical white pixel interpolation image to form the vertical demosaiced color image.

[0019] Optionally, the third interpolation processing, the fourth interpolation processing, the fifth interpolation processing, the sixth interpolation processing, the seventh interpolation processing and the eighth interpolation processing are performed using the same method.

[0020] Optionally, the third interpolation processing, the fourth interpolation processing, the fifth interpolation processing, the sixth interpolation processing, the seventh interpolation processing and the eighth interpolation processing methods include: bilinear interpolation processing, bicubic interpolation processing, mean filter interpolation processing or median filter interpolation processing.

[0021] Optionally, according to the horizontal demosaiced color image and the vertical demosaiced color image, the method for obtaining the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position includes: performing color space conversion on the horizontal demosaiced color image to obtain the horizontal brightness component and the horizontal chromaticity component of each pixel position; performing color space conversion on the vertical demosaiced color image to obtain the vertical brightness component and the vertical chromaticity component of each pixel position; according to the horizontal brightness component and the horizontal chromaticity component of the pixel position on both sides of each pixel position along the horizontal direction, the vertical brightness component and the vertical chromaticity component of the pixel position on both sides of each pixel position along the vertical direction, and the horizontal brightness component and the horizontal chromaticity component of each pixel position The method comprises the following steps: obtaining a horizontal color difference uniformity parameter for each pixel position according to the horizontal brightness component and the horizontal chromaticity component of each pixel position, the horizontal brightness components and the horizontal chromaticity components of multiple pixel positions within a preset uniformity window range centered on each pixel position, and the color difference uniformity threshold of each pixel position; obtaining a vertical color difference uniformity parameter for each pixel position according to the vertical brightness component and the vertical chromaticity component of each pixel position, the vertical brightness component and the vertical chromaticity component of multiple pixel positions within a preset uniformity window range centered on each pixel position, and the color difference uniformity threshold of each pixel position.

[0022] Optionally, the pixels of the horizontal demosaiced color image at each pixel position include at least horizontal red pixels, horizontal green pixels, and horizontal blue pixels, the pixels of the vertical demosaiced color image at each pixel position include at least vertical red pixels, vertical green pixels, and vertical blue pixels, and the horizontal chroma component of each pixel position includes a first horizontal chroma component and a second horizontal chroma component, and the vertical chroma component of each pixel position includes a first vertical chroma component and a second vertical chroma component.

[0023] Optionally, the method for obtaining the color difference uniformity threshold value at each pixel position includes: according to any pixel position [x i ,y i ], and the pixel position [x i ,y i ]The pixel positions on both sides of the horizontal direction [x i -1,y i ] and pixel position [x i +1,y i ] horizontal luminance component, the first horizontal chrominance component and the second horizontal chrominance component, obtain the pixel position [x i ,y i ] contains the specified level of brightness color difference eH_h [xi,yi] ; According to any pixel position [xi ,y i ], and the pixel position [x i ,y i ] The pixel positions on both sides of the vertical direction [x i ,y i -1] and the pixel position [x i ,y i +1], the vertical luminance component, the first vertical chrominance component and the second vertical chrominance component, and obtain the pixel position [x i ,y i ] specifies the vertical brightness color difference eH_v [xi,yi] ; Compare the specified level of brightness color difference eH_h [xi,yi] And specify the vertical brightness color difference eH_v [xi,yi] , get the pixel position [x i ,y i ] color difference uniformity threshold

[0024] Optionally, the pixel position [x i ,y i ] contains the specified level of brightness color difference eH_h [xi,yi] The method includes: according to the pixel position [x i ,y i ] and pixel position [x i -1,y i ] horizontal luminance component, the first horizontal chrominance component and the second horizontal chrominance component, and obtain the pixel position [x i ,y i ] and pixel position [x i -1,y i ] between the horizontal brightness color difference △Eh [xi,yi],[xi-1,yi] ; According to the pixel position [x i ,y i ] and pixel position [x i +1,y i ] horizontal luminance component, the first horizontal chrominance component and the second horizontal chrominance component, and obtain the pixel position [x i ,y i ] and pixel position [x i +1,y i ] between the horizontal brightness color difference △Eh [xi,yi],[xi+1,yi] ; According to the horizontal brightness color difference △Eh [xi,yi],[xi-1,yi] and horizontal brightness color difference △Eh [xi,yi],[xi+1,yi] , get the pixel position [x i ,y i ] contains the specified level of brightness color difference eH_h [xi,yi] =max(ΔEh [xi,yi],[xi-1,yi],ΔEh [xi,yi],[xi+1,yi] ).

[0025] Optionally, get any pixel position [x i ,y i ] and another arbitrary pixel position [x j ,y j ] between the horizontal brightness color difference △Eh [xi,yi],[xj,yj] The method includes: according to the pixel position [x i ,y i ] horizontal luminance component Lh [xi,yi] , the first horizontal chrominance component Ah [xi,yi] and the second horizontal chrominance component Bh [xi,yi] , and the pixel position [x j ,y j ] horizontal luminance component Lh [xj,yj] , the first horizontal chrominance component Ah [xj,yj] and the second horizontal chrominance component Bh [xj,yj] , get in, and

[0026] Optionally, the pixel position [x i ,y i ] specifies the vertical brightness color difference eH_v [xi,yi] The method includes: according to the pixel position [x i ,y i ] and pixel position [x i ,y i -1], the vertical luminance component, the first vertical chrominance component, and the second vertical chrominance component, and obtain the pixel position [x i ,y i ] and pixel position [x i ,y i -1] between the vertical brightness color difference △Ev [xi,yi],[xi,yi-1] ; According to the pixel position [x i ,y i ] and pixel position [x i ,y i +1], the vertical luminance component, the first vertical chrominance component, and the second vertical chrominance component, and obtain the pixel position [x i ,y i ] and pixel position [x i ,y i +1] between the vertical brightness color difference △Ev [xi,yi],[xi,yi+1] ; According to the vertical brightness color difference △Ev [xi,yi],[xi,yi-1] And vertical brightness color difference △Ev[xi,yi],[xi,yi+1] , get the pixel position [x i ,y i ] specifies the vertical brightness color difference eH_v [xi,yi] =max(ΔEv [xi,yi],[xi,yi-1] ,ΔEv [xi,yi],[xi,yi+1] ).

[0027] Optionally, get any pixel position [x i ,y i ] and another arbitrary pixel position [x j ,y j ] between the vertical brightness color difference △Ev [xi,yi],[xj,yj] The method includes: according to the pixel position [x i ,y i ]’s vertical luminance component Lv [xi,yi] , the first vertical chrominance component Av [xi,yi] and the second vertical chrominance component Bv [xi,yi] , and the pixel position [x j ,y j ]’s vertical luminance component Lv [xj,yj] , the first vertical chrominance component Av [xj,yj] and the second vertical chrominance component Bv [xj,yj] , get in, βv [xi,yi],[xj,yj] =(Av [xi,yi] -Av[xj,yj])2, and γv[xi,yi],[xj,yj]=(Bvxi,yi-Bv[xj,yj])2.

[0028] Optionally, the method for obtaining the horizontal color difference uniformity parameter of each pixel position further includes: obtaining N horizontal luminance color differences between the arbitrary pixel position and each pixel position in the N pixel positions according to the horizontal luminance component and the horizontal chrominance component of the arbitrary pixel position, and the horizontal luminance components and the horizontal chrominance components of the N pixel positions within a preset uniformity window range centered on the arbitrary pixel position; comparing the N horizontal luminance color differences with the color difference uniformity threshold of the arbitrary pixel position, respectively, to obtain a horizontal uniformity pixel number Nh, wherein the horizontal uniformity pixel number Nh is: the number of horizontal luminance color differences among the N horizontal luminance color differences that are less than or equal to the color difference uniformity threshold of the arbitrary pixel position; and obtaining a horizontal color difference uniformity parameter homo_h=Nh / N of the arbitrary pixel position according to the horizontal uniformity pixel number Nh.

[0029] Optionally, the method for obtaining the vertical color difference uniformity parameter of each pixel position further includes: obtaining N vertical luminance-containing color differences between the arbitrary pixel position and each pixel position of the N pixel positions according to the vertical luminance component and the vertical chrominance component of the arbitrary pixel position, and the vertical luminance components and the vertical chrominance components of the N pixel positions within a preset uniformity window range centered on the arbitrary pixel position; comparing the N vertical luminance-containing color differences with the color difference uniformity threshold of the arbitrary pixel position, respectively, to obtain a vertical uniformity pixel number Nv, wherein the vertical uniformity pixel number Nv is: the number of vertical luminance-containing color differences among the N vertical luminance-containing color differences that are less than or equal to the color difference uniformity threshold of the arbitrary pixel position; and obtaining a vertical color difference uniformity parameter homo_v=Nv / N of the arbitrary pixel position according to the vertical uniformity pixel number Nv.

[0030] Optionally, the method of obtaining pixels at each pixel position in a horizontally demosaiced color image or a vertically demosaiced color image according to the size relationship between the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position to form a color image includes: when the horizontal color difference uniformity parameter of any pixel position is greater than or equal to the vertical color difference uniformity parameter, obtaining the pixels at the arbitrary pixel position according to the pixels of the horizontally demosaiced color image at the arbitrary pixel position; when the horizontal color difference uniformity parameter of any pixel position is less than the vertical color difference uniformity parameter, obtaining the pixels at the arbitrary pixel position according to the pixels of the vertically demosaiced color image at the arbitrary pixel position.

[0031] Correspondingly, the technical solution of the present invention also provides a color image processing device using any of the above-mentioned color image processing methods, including: a color image sensor, used to obtain a mosaic image to be processed, the mosaic image to be processed includes a plurality of initial white pixels and a plurality of initial color pixels arranged in a two-dimensional array at a plurality of pixel positions, and the initial white pixels and the initial color pixels are arranged alternately in the horizontal direction and the vertical direction; a de-mosaicing unit, used to perform de-mosaicing on the mosaic image to be processed to obtain a color image, including: a first interpolation processing module, used to perform a first interpolation processing on the pixel position where each initial color pixel is located according to the initial white pixels on both sides of each initial color pixel along the horizontal direction, to obtain a horizontal white pixel interpolation image; a horizontal de-mosaicing color image acquisition unit, used to perform a first interpolation processing on the pixel position where each initial color pixel is located according to the initial white pixels on both sides of each initial color pixel along the horizontal direction, to obtain a horizontal white pixel interpolation image; The invention relates to a method for obtaining a horizontal demosaic color image by using a first interpolation processing module, which is used to perform a second interpolation processing on the pixel position where each initial color pixel is located according to the initial white pixels on both sides of each initial color pixel along the vertical direction, so as to obtain a vertical white pixel interpolation image; a vertical demosaic color image acquisition unit, which is used to acquire a vertical demosaic color image according to the vertical white pixel interpolation image and the mosaic image to be processed; a color difference uniformity parameter acquisition unit, which is used to acquire a horizontal color difference uniformity parameter and a vertical color difference uniformity parameter of each pixel position according to the horizontal demosaic color image and the vertical demosaic color image; and a color image acquisition unit, which is used to acquire a pixel at each pixel position in the horizontal demosaic color image or the vertical demosaic color image according to the size relationship between the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position, so as to form a color image.

[0032] Optionally, the multiple initial color pixels include multiple initial red pixels, multiple initial green pixels and multiple initial blue pixels, and the color image processing device also includes: a pixel value uniformity adjustment unit, used to perform pixel value uniformity processing on the mosaic image to be processed to obtain an adjusted mosaic image, the adjusted mosaic image including multiple adjusted red pixels, multiple adjusted green pixels, multiple adjusted blue pixels and multiple adjusted white pixels with equal average pixel values.

[0033] Optionally, the pixel value uniformity adjustment unit includes: an average pixel value acquisition module, used to acquire the average pixel value of the multiple initial red pixels, the average pixel value of the multiple initial green pixels, the average pixel value of the multiple initial blue pixels, and the average pixel value of the multiple initial white pixels; an adjustment coefficient acquisition module, used to acquire a first adjustment coefficient, a second adjustment coefficient, a third adjustment coefficient, and a fourth adjustment coefficient according to the average pixel value of the multiple initial red pixels, the average pixel value of the multiple initial green pixels, the average pixel value of the multiple initial blue pixels, and the average pixel value of the multiple initial white pixels; a uniformity adjustment module, used to adjust the pixel value of each initial red pixel according to the first adjustment coefficient to form a corresponding adjusted red pixel, and adjust the pixel value of each initial green pixel according to the second adjustment coefficient to form a corresponding adjusted green pixel, and adjust the pixel value of each initial blue pixel according to the third adjustment coefficient to form a corresponding adjusted blue pixel, and adjust the pixel value of each initial white pixel according to the fourth adjustment coefficient to form a corresponding adjusted white pixel, so that the average pixel value of the multiple adjusted red pixels, the average pixel value of the multiple adjusted green pixels, the average pixel value of the multiple adjusted blue pixels, and the average pixel value of the multiple adjusted white pixels are equal.

[0034] Optionally, the pixels at each pixel position of the color image include red pixels, green pixels and blue pixels, and the color image processing device also includes: a pixel value uniformity restoration module, used to perform restoration processing on the color image to form a restored color image, and the restoration processing includes: adjusting each red pixel of the color image according to a first adjustment coefficient to form a corresponding restored red pixel, and adjusting each green pixel of the color image according to a second adjustment coefficient to form a corresponding restored green pixel, and adjusting each blue pixel of the color image according to a third adjustment coefficient to form a corresponding restored blue pixel.

[0035] Optionally, the pixels at each pixel position of the color image include red pixels, green pixels, blue pixels and white pixels, and the color image processing device also includes: a pixel value uniformity restoration module, used to perform restoration processing on the color image to form a restored color image, and the restoration processing includes: adjusting each red pixel of the color image according to a first adjustment coefficient to form a corresponding restored red pixel, and adjusting each green pixel of the color image according to a second adjustment coefficient to form a corresponding restored green pixel, and adjusting each blue pixel of the color image according to a third adjustment coefficient to form a corresponding restored blue pixel, and adjusting each white pixel of the color image according to a fourth adjustment coefficient to form a corresponding restored white pixel.

[0036] Optionally, the horizontal demosaic color image acquisition unit includes: a horizontal slowly varying mosaic image acquisition module, which is used to perform pixel value subtraction processing on the adjusted mosaic image and the horizontal white pixel interpolation image at each pixel position to acquire a horizontal slowly varying mosaic image, wherein the horizontal slowly varying mosaic image includes multiple horizontal slowly varying red pixels, multiple horizontal slowly varying green pixels, and multiple horizontal slowly varying blue pixels; a horizontal slowly varying red pixel channel image acquisition module, which performs a third interpolation processing on the horizontal slowly varying mosaic image according to the multiple horizontal slowly varying red pixels to acquire a horizontal slowly varying red pixel channel image, wherein each pixel position of the horizontal slowly varying red pixel channel image has one initial horizontal red pixel; a horizontal red pixel channel image acquisition module, which performs a pixel value addition processing on the horizontal white pixel interpolation image and the horizontal slowly varying red pixel channel image to acquire a horizontal red pixel channel image; and a horizontal slowly varying green pixel channel image acquisition module, which performs a fourth interpolation processing on the horizontal slowly varying mosaic image according to the multiple horizontal slowly varying green pixels. Processing to obtain a horizontal slowly varying green pixel channel image, wherein each pixel position of the horizontal slowly varying green pixel channel image has one initial horizontal green pixel; a horizontal green pixel channel image acquisition module, used to perform pixel-by-pixel addition processing on the horizontal white pixel interpolation image and the horizontal slowly varying green pixel channel image to obtain a horizontal green pixel channel image; a horizontal slowly varying blue pixel channel image acquisition module, used to perform a fifth interpolation processing on the horizontal slowly varying mosaic image according to the multiple horizontal slowly varying blue pixels to obtain a horizontal slowly varying blue pixel channel image, wherein each pixel position of the horizontal slowly varying blue pixel channel image has one initial horizontal blue pixel; a horizontal blue pixel channel image acquisition module, used to perform pixel-by-pixel addition processing on the horizontal white pixel interpolation image and the horizontal slowly varying blue pixel channel image to obtain a horizontal blue pixel channel image; a horizontal merging module, used to merge at least the horizontal red pixel channel image, the horizontal green pixel channel image and the horizontal blue pixel channel image to form a horizontal demosaiced color image.

[0037] Optionally, the horizontal merging module is used to merge the horizontal red pixel channel image, the horizontal green pixel channel image, the horizontal blue pixel channel image and the horizontal white pixel interpolation image to form a horizontal demosaiced color image.

[0038] Optionally, the vertical demosaic color image acquisition unit includes: a vertical slowly varying mosaic image acquisition module, which is used to perform pixel value subtraction processing on the adjusted mosaic image and the vertical white pixel interpolation image at each pixel position to acquire a vertical slowly varying mosaic image, wherein the vertical slowly varying mosaic image includes a plurality of vertical slowly varying red pixels, a plurality of vertical slowly varying green pixels, and a plurality of vertical slowly varying blue pixels; a vertical slowly varying red pixel channel image acquisition module, which is used to obtain the vertical slowly varying mosaic image according to the plurality of vertical slowly varying red pixels. The image is subjected to sixth interpolation processing to obtain a vertical slowly varying red pixel channel image, wherein each pixel position of the vertical slowly varying red pixel channel image has one initial vertical red pixel; a vertical red pixel channel image acquisition module is used to perform pixel-by-pixel addition processing on the vertical white pixel interpolation image and the vertical slowly varying red pixel channel image to obtain a vertical red pixel channel image; a vertical slowly varying green pixel channel image acquisition module is used to perform seventh interpolation processing on the vertical slowly varying mosaic image according to the plurality of vertical slowly varying green pixels; A vertical slowly varying green pixel channel image is obtained by performing pixel-by-pixel processing on the vertical white pixel interpolation image and the vertical slowly varying green pixel channel image to obtain a vertical green pixel channel image; a vertical slowly varying blue pixel channel image acquisition module is used to perform an eighth interpolation processing on the vertical slowly varying mosaic image according to the plurality of vertical slowly varying blue pixels to obtain a vertical slowly varying blue pixel channel image, wherein each pixel position of the vertical slowly varying blue pixel channel image has an initial vertical blue pixel; a vertical blue pixel channel image acquisition module is used to perform pixel-by-pixel processing on the vertical white pixel interpolation image and the vertical slowly varying blue pixel channel image to obtain a vertical blue pixel channel image; and a vertical merging module is used to merge at least the vertical red pixel channel image, the vertical green pixel channel image and the vertical blue pixel channel image to form the vertical demosaiced color image.

[0039] Optionally, the vertical merging module is used to merge the vertical red pixel channel image, the vertical green pixel channel image, the vertical blue pixel channel image and the vertical white pixel interpolation image to form the vertical demosaiced color image.

[0040] Optionally, the color difference uniformity parameter acquisition unit includes: a color space conversion module, which is used to perform color space conversion on the horizontal demosaiced color image to obtain the horizontal brightness component and the horizontal chromaticity component of each pixel position, and to perform color space conversion on the vertical demosaiced color image to obtain the vertical brightness component and the vertical chromaticity component of each pixel position; a color difference uniformity threshold acquisition unit, which is used to obtain the color difference uniformity threshold of each pixel position according to the horizontal brightness component and the horizontal chromaticity component of the pixel position on both sides of each pixel position along the horizontal direction, the vertical brightness component and the vertical chromaticity component of the pixel position on both sides of each pixel position along the vertical direction, and the horizontal brightness component, the horizontal chromaticity component, the vertical brightness component and the vertical chromaticity component of each pixel position. a color difference uniformity threshold set at each pixel position; a horizontal color difference uniformity parameter acquisition module, used to acquire the horizontal color difference uniformity parameter of each pixel position according to the horizontal brightness component and the horizontal chromaticity component of each pixel position, the horizontal brightness components and the horizontal chromaticity components of multiple pixel positions within the preset uniformity window range centered on each pixel position, and the color difference uniformity threshold of each pixel position; a vertical color difference uniformity parameter acquisition module, used to acquire the vertical color difference uniformity parameter of each pixel position according to the vertical brightness component and the vertical chromaticity component of each pixel position, the vertical brightness component and the vertical chromaticity component of multiple pixel positions within the preset uniformity window range centered on each pixel position, and the color difference uniformity threshold of each pixel position.

[0041] Optionally, the horizontal color difference uniformity parameter acquisition module is further used to: acquire N horizontal luminance color differences between the arbitrary pixel position and each of the N pixel positions according to the horizontal luminance component and the horizontal chrominance component of the arbitrary pixel position, and the horizontal luminance components and the horizontal chrominance components of the N pixel positions within a preset uniformity window range centered on the arbitrary pixel position; and, compare the N horizontal luminance color differences with the color difference uniformity threshold of the arbitrary pixel position respectively to acquire a horizontal uniformity pixel number Nh, wherein the horizontal uniformity pixel number Nh is: the number of horizontal luminance color differences among the N horizontal luminance color differences that are less than or equal to the color difference uniformity threshold of the arbitrary pixel position; and, based on the horizontal uniformity pixel number Nh, acquire a horizontal color difference uniformity parameter homo_h=Nh / N of the arbitrary pixel position.

[0042] Optionally, the vertical color difference uniformity parameter acquisition module is further used to: acquire N vertical luminance-containing color differences between the arbitrary pixel position and each of the N pixel positions according to the vertical luminance component and the vertical chrominance component of the arbitrary pixel position, and each vertical luminance component and each vertical chrominance component of the N pixel positions within a preset uniformity window range centered on the arbitrary pixel position; and, compare the N vertical luminance-containing color differences with the color difference uniformity threshold of the arbitrary pixel position respectively to acquire a vertical uniformity pixel number Nv, wherein the vertical uniformity pixel number Nv is: the number of vertical luminance-containing color differences among the N vertical luminance-containing color differences that are less than or equal to the color difference uniformity threshold of the arbitrary pixel position; and, based on the vertical uniformity pixel number Nv, acquire a vertical color difference uniformity parameter homo_v=Nv / N of the arbitrary pixel position.

[0043] Optionally, the color image acquisition unit is further used to: when the horizontal color difference uniformity parameter of any pixel position is greater than or equal to the vertical color difference uniformity parameter, acquire the pixel at the arbitrary pixel position according to the pixel of the horizontal demosaiced color image at the arbitrary pixel position; and when the horizontal color difference uniformity parameter of any pixel position is less than the vertical color difference uniformity parameter, acquire the pixel at the arbitrary pixel position according to the pixel of the vertical demosaiced color image at the arbitrary pixel position.

[0044] Compared with the prior art, the technical solution of the embodiment of the present invention has the following beneficial effects:

[0045] In the color image processing method provided by the technical solution of the present invention, the first interpolation processing and the second interpolation processing are respectively performed according to the initial white pixels on both sides of each initial color pixel along the horizontal direction and the initial white pixels on both sides of each initial color pixel along the vertical direction, so as to obtain a horizontal white pixel interpolation image and a vertical white pixel interpolation image, and a horizontal demosaiced color image and a vertical demosaiced color image are formed according to the horizontal white pixel interpolation image, the vertical white pixel interpolation image, and the mosaic image to be processed. Therefore, the horizontal demosaiced color image and the vertical demosaiced color image both contain information of white pixels and information of color pixels. On this basis, according to the horizontal demosaiced color image and the vertical demosaiced color image, the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position are obtained, and according to the size relationship between the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position, the pixel at each pixel position is obtained in the horizontal demosaiced color image or the vertical demosaiced color image to form a color image, so that the information of white pixels and color pixels is used at the same time, and the color difference uniformity corresponding to each pixel position in the horizontal direction and the vertical direction is compared, so that when the white pixel interpolation direction with better color difference uniformity is judged for each pixel position, the judgment accuracy of the interpolation direction can be improved. Therefore, in the horizontal demosaiced color image or the vertical demosaiced color image, a more accurate interpolated color pixel at each pixel position can be selected, thereby reducing the pseudo color in the color image and improving the quality of the color image after demosaicing. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 is a schematic flow chart of a color image processing method according to an embodiment of the present invention;

[0047] Figures 2 to 13 is a structural schematic diagram of each step of an image processing method according to an embodiment of the present invention;

[0048] Fig.14 A color image processing device according to an embodiment of the present invention;

[0049] Fig.15 is a schematic structural diagram of a horizontal demosaic color image acquisition unit according to an embodiment of the present invention;

[0050] Fig.16 is a structural schematic diagram of a vertical demosaic color image acquisition unit according to an embodiment of the present invention;

[0051] Fig.17 is a structural schematic diagram of a color difference uniformity parameter acquisition unit according to an embodiment of the present invention;

[0052] Fig.18is a structural schematic diagram of a color difference uniformity threshold acquisition unit according to an embodiment of the present invention;

[0053] Fig.19 is a flowchart of a color image processing method according to another embodiment of the present invention;

[0054] Figures 20 to 32 is a structural schematic diagram of each step of an image processing method according to another embodiment of the present invention;

[0055] Fig.33 is a color image processing device according to another embodiment of the present invention;

[0056] Fig.34 is a structural schematic diagram of a horizontal demosaic color image acquisition unit according to another embodiment of the present invention;

[0057] Fig.35 is a schematic structural diagram of a vertical demosaic color image acquisition unit according to another embodiment of the present invention;

[0058] Fig.36 is a structural schematic diagram of a color difference uniformity parameter acquisition unit according to another embodiment of the present invention;

[0059] Fig.37 It is a structural schematic diagram of a color difference uniformity threshold acquisition unit according to another embodiment of the present invention. DETAILED DESCRIPTION

[0060] As described in the background technology, when an RGB color image is formed by interpolating W pixels, only 50% of the information of the W pixels is interpolated. Therefore, the accuracy of the W pixel interpolation is poor, resulting in a large amount of pseudo colors in the RGB color image after de-mosaicing, and the quality of the RGB color image is poor.

[0061] In order to solve the above technical problems, the technical solution of the present invention provides a color image processing method and device thereof, because according to the horizontal demosaic color image and the vertical demosaic color image, the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position are obtained, and the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position are compared, and the pixel of each pixel position is obtained to form a color image, including: when the horizontal color difference uniformity parameter of any pixel position is greater than or equal to the vertical color difference uniformity parameter, according to the pixel of the horizontal demosaic color image at the any pixel position, the pixel of the any pixel position is obtained; when the horizontal color difference uniformity parameter of any pixel position is less than the vertical color difference uniformity parameter, according to the pixel of the vertical demosaic color image at the any pixel position, the pixel of the any pixel position is obtained. Therefore, the pseudo color of the demosaiced color image can be reduced, and the quality of the demosaiced color image can be improved.

[0062] In order to make the above-mentioned objects, features and beneficial effects of the present invention more obvious and easy to understand, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0063] Figure 1 It is a flowchart of a color image processing method according to an embodiment of the present invention.

[0064] Please refer to Figure 1 , the color image processing method comprises:

[0065] Step S10, obtaining a mosaic image to be processed, wherein the mosaic image to be processed includes a plurality of initial white pixels and a plurality of initial color pixels arranged in a two-dimensional array at a plurality of pixel positions;

[0066] Step S20, performing a first interpolation process on the pixel position where each initial color pixel is located according to the initial white pixels on both sides of each initial color pixel along the horizontal direction, to obtain a horizontal white pixel interpolation image;

[0067] Step S30, acquiring a horizontal demosaiced color image according to the horizontal white pixel interpolation image and the mosaic image to be processed;

[0068] Step S40, performing a second interpolation process on the pixel position where each initial color pixel is located according to the initial white pixels on both sides of each initial color pixel along the vertical direction, to obtain a vertical white pixel interpolation image;

[0069] Step S50, acquiring a vertical demosaiced color image according to the vertical white pixel interpolation image and the mosaic image to be processed;

[0070] Step S60, acquiring a horizontal color difference uniformity parameter and a vertical color difference uniformity parameter of each pixel position according to the horizontal demosaiced color image and the vertical demosaiced color image;

[0071] Step S70 , according to the magnitude relationship between the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position, in the horizontal demosaiced color image or the vertical demosaiced color image, the pixel at each pixel position is acquired to form a color image.

[0072] Figures 2 to 13 It is a structural schematic diagram of each step of an image processing method according to an embodiment of the present invention.

[0073] Please refer to Figure 2 , obtaining a mosaic image 100 to be processed, wherein the mosaic image 100 to be processed includes a plurality of initial white pixels 104 and a plurality of initial color pixels arranged in a two-dimensional array at a plurality of pixel positions 100a.

[0074] In this embodiment, the plurality of initial color pixels include a plurality of initial red pixels 101 , a plurality of initial green pixels 102 , and a plurality of initial blue pixels 103 .

[0075] It should be noted that, for ease of understanding, Figure 2 A pixel position 100a is schematically indicated by a dotted line.

[0076] Specifically, in the horizontal direction X, the initial white pixels 104 and the initial color pixels are arranged alternately, and in the vertical direction Y, the initial white pixels 104 and the initial color pixels are arranged alternately.

[0077] Accordingly, the number of the initial white pixels 104 accounts for 50% of the total number of pixels of the mosaic image 100 to be processed.

[0078] In addition, in the horizontal direction X, the initial red pixels 101, the initial green pixels 102 and the initial blue pixels 103 are periodically arranged alternately, and in the vertical direction Y, the initial red pixels 101, the initial green pixels 102 and the initial blue pixels 103 are periodically arranged alternately.

[0079] It should be noted that the mosaic image 100 to be processed is an original image captured by a single color image sensor, and is a mosaic image that is consistent with the arrangement of the color filter array installed on the color image sensor. The mosaic image 100 to be processed must be de-mosaiced to generate a color image that can be used for viewing.

[0080] Please refer to Figure 3 According to the initial white pixels 104 on both sides of each initial color pixel along the horizontal direction X, the pixel position 100a (such as Figure 2 As shown in the figure, a first interpolation process is performed to obtain a horizontal white pixel interpolation image 110.

[0081] In this embodiment, the first interpolation process includes: according to the horizontal direction X, i (like Figure 2 The pixel values ​​T1 of the two adjacent initial white pixels 104 are shown as follows: i and pixel value T2 i , obtain the initial color pixel C i (like Figure 2 ) at pixel position 100a i (like Figure 3 The horizontal white pixel interpolation Th i =(T1 i +T2 i ) / 2.

[0082] Specifically, after the first interpolation process, the horizontal white pixel interpolation image 110 includes: a plurality of initial white pixels 104 and a plurality of horizontal interpolation white pixels 114. i The pixel value of the horizontal interpolation white pixel 114 is Th i =(T1 i +T2 i Furthermore, the plurality of initial white pixels 104 and the plurality of horizontal interpolation white pixels 114 are arranged at intervals in both the horizontal direction X and the vertical direction Y.

[0083] Next, according to the horizontal white pixel interpolation image 110 and the mosaic image to be processed 100, a horizontal demosaic color image 140 (eg Figure 6 For specific steps of obtaining the horizontal demosaiced color image 160, please refer to Figures 4 to 6 .

[0084] Please refer to Figure 4 , a pixel value subtraction process is performed on the mosaic image 100 to be processed and the horizontal white pixel interpolation image 110 at each pixel position 100 a to obtain a horizontal intermediate mosaic image 120 to be processed.

[0085] Specifically, the horizontal intermediate mosaic image 120 to be processed includes: a plurality of horizontal intermediate red pixels 121 located at the same pixel position 100a as the plurality of initial red pixels 101, a plurality of horizontal intermediate green pixels 122 located at the same pixel position 100a as the plurality of initial green pixels 102, and a plurality of horizontal intermediate blue pixels 123 located at the same pixel position 100a as the plurality of initial blue pixels 103.

[0086] Specifically, the pixel value R1h=R-Th of any horizontal middle red pixel 121, wherein R is the pixel value of the initial red pixel 101 at the same pixel position 100a as the arbitrary horizontal middle red pixel 121, and Th is the pixel value of the horizontal interpolated white pixel 114 at the same pixel position 100a as the arbitrary horizontal middle red pixel 121.

[0087] Similarly, the pixel value G1h=G-Th of any horizontal middle green pixel 122, wherein G is the pixel value of the initial green pixel 102 at the same pixel position 100a as the arbitrary horizontal middle green pixel 122, and Th is the pixel value of the horizontal interpolated white pixel 114 at the same pixel position 100a as the arbitrary horizontal middle green pixel 122.

[0088] Similarly, the pixel value B1h=B-Th of any horizontal middle blue pixel 123, wherein B is the pixel value of the initial blue pixel 103 at the same pixel position 100a as the arbitrary horizontal middle blue pixel 123, and Th is the pixel value of the horizontal interpolated white pixel 114 at the same pixel position 100a as the arbitrary horizontal middle blue pixel 123.

[0089] Similarly, at the pixel position 100a where any initial white pixel 104 is located, the corresponding pixel value in the horizontal middle mosaic image 120 to be processed is 0 (eg Figure 4 shown).

[0090] Please refer to Figure 5 , according to multiple horizontal intermediate red pixels 121, a third interpolation process is performed on the horizontal intermediate mosaic image 120 to be processed, and an initial horizontal demosaiced red pixel channel image 130a is obtained, and each pixel position 100a of the initial horizontal demosaiced red pixel channel image 130a has 1 initial horizontal red pixel 131.

[0091] The third interpolation processing method includes: bilinear interpolation processing, bicubic interpolation processing, mean filter interpolation processing or median filter interpolation processing.

[0092] For ease of understanding, the third interpolation process is taken as an example of mean filtering to illustrate the working method of obtaining the initial horizontal demosaiced red pixel channel image 130a.

[0093] Specifically, the method for obtaining the initial horizontal demosaiced red pixel channel image 130a includes: providing a filter window of a preset size; based on the horizontal intermediate mosaic image 120 to be processed, traversing each pixel position 100a with the filter window to obtain the initial horizontal red pixel 131 of each pixel position 100a.

[0094] The filter window of the preset size is, for example, a filter window of a size of 9*9 pixels.

[0095] Specifically, when the filter window traverses to any pixel position 100a i When the arbitrary pixel position 100a is obtained i The method of setting the initial horizontal red pixel 131 comprises: making the arbitrary pixel position 100a i Located at the center of the filter window; according to the total pixel value ∑R1h of all horizontal middle red pixels 121 within the current range of the filter window, and the total number K of horizontal middle red pixels 121 within the current range of the filter window R , obtain the arbitrary pixel position 100a iThe pixel value of the initial horizontal red pixel 131 is mR1h=(∑R1h) / K R .

[0096] Thus, the pixel value mR1h of the initial horizontal red pixel 131 at each pixel position 100a is obtained to form an initial horizontal demosaiced red pixel channel image 130a.

[0097] Please continue to refer to Figure 5 According to multiple horizontal intermediate green pixels 122, a fourth interpolation process is performed on the horizontal intermediate mosaic image 120 to be processed, and an initial horizontal demosaiced green pixel channel image 130b is obtained, and each pixel position 100a of the initial horizontal demosaiced green pixel channel image 130b has one initial horizontal green pixel 132.

[0098] The fourth interpolation processing method includes: bilinear interpolation processing, bicubic interpolation processing, mean filter interpolation processing or median filter interpolation processing.

[0099] Similarly, through the fourth interpolation process, the pixel value mG1h of the initial horizontal green pixel 132 of each pixel position 100a is obtained to form an initial horizontal demosaiced green pixel channel image 130b.

[0100] Please continue to refer to Figure 5 According to multiple horizontal intermediate blue pixels 123, a fifth interpolation process is performed on the horizontal intermediate mosaic image 120 to be processed, and an initial horizontal demosaiced blue pixel channel image 130c is obtained, and each pixel position 100a of the initial horizontal demosaiced blue pixel channel image 130c has one initial horizontal blue pixel 133.

[0101] The fifth interpolation processing method includes: bilinear interpolation processing, bicubic interpolation processing, mean filter interpolation processing or median filter interpolation processing.

[0102] Similarly, through the fifth interpolation process, the pixel value mB1h of the initial horizontal blue pixel 133 of each pixel position 100a is obtained to form an initial horizontal demosaiced blue pixel channel image 130c.

[0103] In this embodiment, the third interpolation process, the fourth interpolation process and the fifth interpolation process are performed in the same manner, so that the relative deviations between the initial horizontal demosaiced red pixel channel image 130a, the initial horizontal demosaiced green pixel channel image 130b and the initial horizontal demosaiced blue pixel channel image 130c can be reduced, further improving the quality of the formed color image.

[0104] For specific working methods of the fourth interpolation processing and the fifth interpolation processing, reference may be made to the illustrative description of the working method of the third interpolation processing in this embodiment, which will not be described in detail here.

[0105] Please refer to Figure 6 , the horizontal white pixel interpolation image 110 and the initial horizontal demosaiced red pixel channel image 130a are added pixel by pixel at position 100a to obtain a horizontal red pixel channel image 140a.

[0106] Specifically, in the horizontal red pixel channel image 140a, any pixel position 100a i The pixel value R2h of the horizontal red pixel 141 i =mR1h i +Th i , wherein the mR1h i is the arbitrary pixel position 100a i The initial horizontal pixel value of the red pixel 131, the Th i is the horizontal white pixel interpolation image 110 at the arbitrary pixel position 10a i The pixel value of .

[0107] Please continue to refer to Figure 6 , the horizontal white pixel interpolation image 110 and the initial horizontal demosaiced green pixel channel image 130b are added pixel by pixel at position 100a to obtain a horizontal green pixel channel image 140b.

[0108] Specifically, in the horizontal green pixel channel image 140b, any pixel position 100a i The pixel value G2h of the horizontal green pixel 142 i =mG1h i +Th i , wherein the mG1h i is the arbitrary pixel position 100a i The initial horizontal pixel value of the green pixel 132, the Th i is the horizontal white pixel interpolation image 110 at the arbitrary pixel position 10a i The pixel value of .

[0109] Please continue to refer to Figure 6 , the horizontal white pixel interpolation image 110 and the initial horizontal demosaiced blue pixel channel image 130c are added pixel by pixel at position 100a to obtain a horizontal blue pixel channel image 140c.

[0110] Specifically, in the horizontal blue pixel channel image 140c, any pixel position 100a iThe pixel value B2h of the horizontal blue pixel 143 i =mB1h i +Th i , wherein the mB1h i is the arbitrary pixel position 100a i The initial horizontal pixel value of the blue pixel 133, the Th i is the horizontal white pixel interpolation image 110 at the arbitrary pixel position 10a i The pixel value of .

[0111] Please continue to refer to Figure 6 , the horizontal red pixel channel image 140a, the horizontal green pixel channel image 140b and the horizontal blue pixel channel image 140c are merged to form a horizontal demosaiced color image 140.

[0112] Thus, a horizontal demosaic color image 140 including information of white pixels and information of color pixels and interpolated in the horizontal direction X is formed.

[0113] Specifically, the horizontal demosaiced color image 140 has three complete pixel channels, that is, the pixels of the horizontal demosaiced color image 140 at each pixel position 100 a include: a horizontal red pixel 141 , a horizontal green pixel 142 , and a horizontal blue pixel 143 .

[0114] In some other embodiments, the horizontal red pixel channel image 140a, the horizontal green pixel channel image 140b, the horizontal blue pixel channel image 140c and the horizontal white pixel interpolation image 110 are merged to form a horizontal demosaic color image. Compared with the horizontal demosaic color image 140, the horizontal demosaic color image has a total of 4 complete pixel channels. That is, the pixels of the horizontal demosaic color image at each pixel position 100a include: horizontal red pixels 141, horizontal green pixels 142, horizontal blue pixels 143 and initial white pixels 104, or horizontal red pixels 141, horizontal green pixels 142, horizontal blue pixels 143 and horizontal interpolation white pixels 114, therefore, it is beneficial to further improve the quality of the formed color image.

[0115] Please refer to Figure 7 According to the initial white pixels 104 on both sides of each initial color pixel along the vertical direction Y, the pixel position 100a (such as Figure 2 As shown in FIG. 1 , a second interpolation process is performed to obtain a vertical white pixel interpolation image 150.

[0116] In this embodiment, the second interpolation process includes: according to the vertical direction Y, i(like Figure 2 The pixel value T3 of two adjacent initial white pixels 104 is shown as follows: i and pixel value T4 i , obtain the initial color pixel C i Pixel location 100a i (like Figure 7 The vertical white pixel interpolation Tv i =(T3 i +T4 i ) / 2.

[0117] Specifically, after the second interpolation process, the vertical white pixel interpolation image 150 includes: a plurality of initial white pixels 104 and a plurality of vertical interpolation white pixels 154. i The vertical interpolation white pixel 154 has a pixel value of Tv i =(T3 i +T4 i Furthermore, the plurality of initial white pixels 104 and the plurality of vertical interpolation white pixels 154 are arranged at intervals in both the horizontal direction X and the vertical direction Y.

[0118] Next, according to the vertical white pixel interpolation image 150 and the mosaic image to be processed 100, a vertical demosaiced color image 180 (eg Fig.10 For specific steps of obtaining the vertical demosaiced color image 180, please refer to Figures 8 to 10 .

[0119] Please refer to Figure 8 , a pixel value subtraction process is performed on the mosaic image 100 to be processed and the vertical white pixel interpolation image 150 at each pixel position 100 a to obtain a vertical intermediate mosaic image 160 to be processed.

[0120] Specifically, the vertical intermediate mosaic image 160 to be processed includes: a plurality of vertical intermediate red pixels 161 located at the same pixel position 100a as the plurality of initial red pixels 101, a plurality of vertical intermediate green pixels 162 located at the same pixel position 100a as the plurality of initial green pixels 102, and a plurality of vertical intermediate blue pixels 163 located at the same pixel position 100a as the plurality of initial blue pixels 103.

[0121] Specifically, the pixel value R1v=R-Tv of any vertical middle red pixel 161, wherein R is the pixel value of the initial red pixel 101 at the same pixel position 100a as the arbitrary vertical middle red pixel 161, and Tv is the pixel value of the vertical interpolated white pixel 154 at the same pixel position 100a as the arbitrary vertical middle red pixel 161.

[0122] Similarly, the pixel value G1v=G-Tv of any vertical middle green pixel 162, wherein G is the pixel value of the initial green pixel 102 at the same pixel position 100a as the arbitrary vertical middle green pixel 162, and Tv is the pixel value of the vertical interpolated white pixel 154 at the same pixel position 100a as the arbitrary vertical middle green pixel 162.

[0123] Similarly, the pixel value B1v=B−Tv of any vertical middle blue pixel 163, wherein B is the pixel value of the initial blue pixel 103 at the same pixel position 100a as the arbitrary vertical middle blue pixel 163, and Tv is the pixel value of the vertical interpolated white pixel 154 at the same pixel position 100a as the arbitrary vertical middle blue pixel 163.

[0124] Similarly, at the pixel position 100a where any initial white pixel 104 is located, the corresponding pixel value in the vertical middle mosaic image 160 to be processed is 0 (e.g. Figure 8 shown).

[0125] Please refer to Fig. 9 According to multiple vertical intermediate red pixels 161, a sixth interpolation process is performed on the vertical intermediate mosaic image 160 to obtain an initial vertical demosaiced red pixel channel image 170a, and each pixel position 100a of the initial vertical demosaiced red pixel channel image 170a has one initial vertical red pixel 171.

[0126] The sixth interpolation processing method includes: bilinear interpolation processing, bicubic interpolation processing, mean filter interpolation processing or median filter interpolation processing.

[0127] Similarly to the third interpolation process, the pixel value mR1h of the initial horizontal red pixel 131 of each pixel position 100a is obtained to form the initial horizontal demosaic red pixel channel image 130a. Through the sixth interpolation process, the pixel value mR1v of the initial vertical red pixel 171 of each pixel position 100a is obtained to form the initial vertical demosaic red pixel channel image 170a.

[0128] Please continue to refer to Fig. 9 According to multiple vertical intermediate green pixels 162, the seventh interpolation processing is performed on the vertical intermediate mosaic image 160 to obtain an initial vertical demosaiced green pixel channel image 170b, and each pixel position 100a of the initial vertical demosaiced green pixel channel image 170b has one initial vertical green pixel 172.

[0129] The seventh interpolation processing method includes: bilinear interpolation processing, bicubic interpolation processing, mean filter interpolation processing or median filter interpolation processing.

[0130] Similarly, through the seventh interpolation process, the pixel value mG1v of the initial vertical green pixel 172 of each pixel position 100a is obtained to form an initial vertical demosaiced green pixel channel image 170b.

[0131] Please continue to refer to Fig. 9 According to multiple vertical intermediate blue pixels 163, the eighth interpolation processing is performed on the vertical intermediate mosaic image 160 to obtain an initial vertical demosaiced blue pixel channel image 170c, and each pixel position 100a of the initial vertical demosaiced blue pixel channel image 170c has one initial vertical blue pixel 173.

[0132] The eighth interpolation processing method includes: bilinear interpolation processing, bicubic interpolation processing, mean filter interpolation processing or median filter interpolation processing.

[0133] Similarly, through the eighth interpolation process, the pixel value mB1v of the initial vertical blue pixel 173 of each pixel position 100a is obtained to form an initial vertical demosaiced green pixel channel image 170c.

[0134] In this embodiment, the sixth interpolation processing, the seventh interpolation processing, and the eighth interpolation processing methods are the same as the third interpolation processing, the fourth interpolation processing, and the fifth interpolation processing methods, so as to further improve the quality of the formed color image.

[0135] For specific working methods of the sixth interpolation processing, the seventh interpolation processing, and the eighth interpolation processing, reference may be made to the illustrative description of the working method of the third interpolation processing in this embodiment, which will not be repeated here.

[0136] In other embodiments, the methods of the third interpolation process, the fourth interpolation process, the fifth interpolation process, the sixth interpolation process, the seventh interpolation process, and the eighth interpolation process may also be different from each other.

[0137] Please refer to Fig.10 , the vertical white pixel interpolation image 150 and the initial vertical demosaiced red pixel channel image 170a are added pixel by pixel at position 100a to obtain a vertical red pixel channel image 180a.

[0138] Specifically, in the vertical red pixel channel image 180a, any pixel position 100a i The pixel value R2v of the vertical red pixel 181 i =mR1v i +Tvi , wherein the mR1v i is the arbitrary pixel position 100a i The initial vertical red pixel 171 pixel value, the Tv i is the vertical white pixel interpolation image 150 at the arbitrary pixel position 100a i The pixel value of .

[0139] Please continue to refer to Fig.10 , the vertical white pixel interpolation image 150 and the initial vertical demosaiced green pixel channel image 170b are added pixel by pixel at position 100a to obtain a vertical green pixel channel image 180b.

[0140] Specifically, in the vertical green pixel channel image 180b, any pixel position 100a i The pixel value G2v of the vertical green pixel 182 i =mG1v i +Tv i , wherein the mG1v i is the vertical white pixel interpolation image 150 at the arbitrary pixel position 100a i The pixel value of Tv i is the arbitrary pixel position 100a i The pixel value of the vertically interpolated white pixel 154.

[0141] Please continue to refer to Fig.10 , the vertical white pixel interpolation image 150 and the initial vertical demosaiced blue pixel channel image 170c are added at pixel position 100a to obtain a vertical blue pixel channel image 180c.

[0142] Specifically, in the vertical blue pixel channel image 180c, any pixel position 100a i The pixel value B2v of the vertical blue pixel 183 i =mB1v i +Tv i , wherein the mB1v i is the arbitrary pixel position 100a i The initial vertical blue pixel 173 pixel value, the Tv i is the vertical white pixel interpolation image 150 at the arbitrary pixel position 100a i The pixel value of .

[0143] Please continue to refer to Fig.10, the vertical red pixel channel image 180a, the vertical green pixel channel image 180b and the vertical blue pixel channel image 180c are merged to form a vertical demosaiced color image 180.

[0144] Thus, a vertical demosaiced color image 180 including information of white pixels and information of color pixels and interpolated in the vertical direction Y is formed.

[0145] Specifically, the vertical demosaiced color image 180 has three complete pixel channels, that is, the pixels of the vertical demosaiced color image 180 at each pixel position 100 a include: a vertical red pixel 181 , a vertical green pixel 182 , and a vertical blue pixel 183 .

[0146] In some other embodiments, the vertical red pixel channel image 180a, the vertical green pixel channel image 180b, the vertical blue pixel channel image 180c and the vertical white pixel interpolation image 150 are combined to form a vertical demosaic color image. Compared with the vertical demosaic color image 180, the vertical demosaic color image has a total of 4 complete pixel channels. That is, the pixels of the vertical demosaic color image at each pixel position 100a include: a vertical red pixel 181, a vertical green pixel 182, a vertical blue pixel 183 and an initial white pixel 104, or a vertical red pixel 181, a vertical green pixel 182, a vertical blue pixel 183 and a vertical interpolation white pixel 154, therefore, it is beneficial to further improve the quality of the formed color image.

[0147] Next, according to the horizontal demosaiced color image 140 and the vertical demosaiced color image 180, the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position 100a are obtained. Figure 6 , Fig.10 , Fig.11 and Fig.12 The method of obtaining the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position 100 a is described in detail.

[0148] Please refer to Figure 6 and Fig.10 , perform color space conversion on the horizontal demosaiced color image 140 to obtain the horizontal brightness component Lh and the horizontal chrominance component of each pixel position 100a.

[0149] In this embodiment, the horizontal chrominance component of each pixel position 100a includes: a first horizontal chrominance component Ah and a second horizontal chrominance component Bh.

[0150] In this embodiment, according to the horizontal demosaiced color image 140 and the vertical demosaiced color image 180, the method for obtaining the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position 100a further includes: performing color space conversion on the vertical demosaiced color image 140 to obtain the vertical brightness component Lv and the vertical chromaticity component of each pixel position 100a.

[0151] In this embodiment, the vertical chromaticity components of each pixel position 100a include: a first vertical chromaticity component Av and a second vertical chromaticity component Bv.

[0152] Specifically, in this embodiment, the horizontal demosaiced color image 140 and the vertical demosaiced color image 180 are converted from the RGB color space to the CIELAB color space to obtain corresponding brightness components and chrominance components.

[0153] In this embodiment, according to the horizontal demosaiced color image 140 and the vertical demosaiced color image 180, the method for obtaining the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position 100a further includes: obtaining the color difference uniformity threshold eH of each pixel position 100a according to the horizontal brightness component Lh and the horizontal chromaticity component of the pixel position 100a on both sides of each pixel position 100a along the horizontal direction X, the vertical brightness component Lv and the vertical chromaticity component of the pixel position 100a on both sides of each pixel position 100a along the vertical direction Y, and the horizontal brightness component Lh, the horizontal chromaticity component, the vertical brightness component Lv and the vertical chromaticity component of each pixel position 100a.

[0154] The following will be based on Fig.11 A method of obtaining the color difference uniformity threshold value eH at each pixel position 100a is described in detail.

[0155] Please refer to Fig.11 , according to the horizontal luminance component Lh, the first horizontal chrominance component and the second horizontal chrominance component of the arbitrary pixel position 100a[xi,yi], and the pixel positions 100a[xi-1,yi] and 100a[xi+1,yi] on both sides of the pixel position 100a[xi,yi] along the horizontal direction X, obtain the specified horizontal luminance color difference eH_h of the pixel position 100a[xi,yi] [xi,yi] .

[0156] In this embodiment, the specified horizontal brightness color difference eH_h of the pixel position 100a[xi,yi] is obtained. [xi,yi]The method includes: obtaining a horizontal luminance color difference △Eh between the pixel position 100a[xi,yi] and the pixel position 100a[xi-1,yi] according to the horizontal luminance component Lv, the first horizontal chrominance component Ah and the second horizontal chrominance component Bh of the pixel position 100a[xi,yi] and the pixel position 100a[xi-1,yi] [xi,yi],[xi-1,yi] ; According to the pixel position 100a[x i ,y i ] and pixel position 100a[x i +1,y i ], the horizontal luminance component Lv, the first horizontal chrominance component Ah and the second horizontal chrominance component Bh, and the pixel position 100a[x i ,y i ] and pixel position 100a[x i +1,y i ] between the horizontal brightness color difference △Eh [xi,yi],[xi+1,yi] ; According to the horizontal brightness color difference △Eh [xi,yi],[xi-1,yi] and horizontal brightness color difference △Eh [xi,yi],[xi+1,yi] , get the pixel position [x i ,y i ] contains the specified level of brightness color difference eH_h [xi,yi] =max(ΔEh [xi,yi],[xi-1,yi] ,ΔEh [xi,yi],[xi+1,yi] ).

[0157] Specifically, [xi,yi] =max(ΔEh [xi,yi],[xi-1,yi] ,ΔEh [xi,yi],[xi+1,yi] ) means: comparison of horizontal brightness color difference △Eh [xi,yi],[xi-1,yi] and horizontal brightness color difference △Eh [xi,yi],[xi+1,yi] , the larger of the two is used as the specified horizontal luminance color difference eH_h at the pixel position 100a[xi,yi] [xi,yi] .

[0158] In this embodiment, obtaining an arbitrary pixel position 100a[x i ,y i ], and another arbitrary pixel position 100a[x j ,y j ] between the horizontal brightness color difference △Eh [xi,yi],[xj,yj] The method includes: according to the pixel position 100a[x i ,y i ] horizontal luminance component Lh [xi,yi] , the first horizontal chrominance component Ah [xi,yi] and the second horizontal chrominance component Bh [xi,yi] , and the pixel position 100a[x j,y j ] horizontal luminance component Lh [xj,yj] , the first horizontal chrominance component Ah [xj,yj] and the second horizontal chrominance component Bh [xj,yj] , get the level containing brightness and color difference

[0159] Among them, αh [xi,yi],[xj,yj] =(Lh [xi,yi] -Lh [xj,yj] ) 2 ,

[0160] βh [xi,yi],[xj,yj] =(Ah [xi,yi] -Ah [xj,yj] ) 2 ,and, 2

[0162] γh [xi,yi],[xj,yj] =(Bh [xi,yi] -Bh [xj,yj] ).

[0163] Please continue to refer to Fig.11 , according to the vertical luminance component Lv, the first vertical chrominance component and the second vertical chrominance component of the arbitrary pixel position 100a[xi,yi], and the pixel position 100a[xi,yi-1] and the pixel position 100a[xi,yi+1] on both sides of the pixel position 100a[xi,yi] along the vertical direction Y, obtain the specified vertical luminance color difference eH_v of the pixel position 100a[xi,yi] [xi,yi] .

[0164] In this embodiment, the pixel position 100a[x i ,y i ] specifies the vertical brightness color difference eH_v [xi,yi] The method includes: according to the pixel position 100a[x i ,y i ] and pixel position 100a[x i ,y i -1], the vertical luminance component Lv, the first vertical chrominance component Av and the second vertical chrominance component Bv, and obtain the pixel position 100a[x i ,y i ] and pixel position 100a[x i ,y i -1] between the vertical brightness color difference △Ev [xi,yi],[xi,yi-1] ; According to the pixel position 100a[x i ,y i ] and pixel position 100a[x i ,y i+1], the vertical luminance component Lv, the first vertical chrominance component Av and the second vertical chrominance component Bv, and obtain the pixel position 100a[x i ,y i ] and pixel position 100a[x i ,y i +1] between the vertical brightness color difference △Ev [xi,yi],[xi,yi+1] ; According to the vertical brightness color difference △Ev [xi,yi],[xi,yi-1] And vertical brightness color difference △Ev [xi,yi],[xi,yi+1] , get the pixel position 100a[x i ,y i ] specifies the vertical brightness color difference eH_v [xi,yi] =max(ΔEv [xi,yi],[xi,yi-1] ,ΔEv [xi,yi],[xi,yi+1] ).

[0165] Specifically, eH_v [xi,yi] =max(ΔEv [xi,yi],[xi,yi-1] ,ΔEv [xi,yi],[xi,yi+1] ) means: compare vertical brightness color difference △Ev [xi,yi],[xi,yi-1] And vertical brightness color difference △Ev [xi,yi],[xi,yi+1] , the larger of the two is taken as the pixel position 100a[x i ,y i ] specifies the vertical brightness color difference eH_v [xi,yi] .

[0166] In this embodiment, obtaining an arbitrary pixel position 100a[x i ,y i ], and another arbitrary pixel position 100a[x j ,y j ] between the vertical brightness color difference △Ev [xi,yi],[xj,yj] The method includes: according to the pixel position 100a[x i ,y i ]’s vertical luminance component Lv [xi,yi] , the first vertical chrominance component Av [xi,yi] and the second vertical chrominance component Bv [xi,yi] , and the pixel position 100a[x j ,y j ]’s vertical luminance component Lv [xj,yj] , the first vertical chrominance component Av [xj,yj] and the second vertical chrominance component Bv [xj,yj] , get the vertical brightness color difference

[0167] Among them, αv [xi,yi],[xj,yj] =(Lv [xi,yi] -Lv [xj,yj]) 2 ,

[0168] βv [xi,yi],[xj,yj] =(Av [xi,yi] -Av [xj,yj] ) 2 ,and,

[0169] γv [xi,yi],[xj,yj] =(Bv [xi,yi] -Bv [xj,yj] ) 2 .

[0170] Please continue to refer to Fig.11 , compare the specified level containing luminance color difference eH_h [xi,yi] and the specified vertical luminance color difference eH_v [xi,yi] , get the pixel position 100a[x i ,y i ] color difference uniformity threshold eH [xi,yi] =min(eH_h [xi,yi] ,eH_v [xi,yi] ).

[0171] Specifically, the color difference uniformity threshold eH [xi,yi] =min(eH_h [xi,yi] ,eH_v [xi,yi] ) means: with a specified level of brightness color difference eH_h [xi,yi] And specify the vertical brightness color difference eH_v [xi,yi] The smaller one is used as the color difference uniformity threshold eH [xi,yi] .

[0172] It should be noted that Fig.11 The pixel position 100a of the 3*3 range is schematically shown in FIG. 1 for easy understanding: any pixel position 100a[x i ,y i ], the pixel position 100a[x i ,y i ] The pixel positions 100a[x i -1,y i ] and pixel position 100a[x i +1,y i ], and the pixel position 100a[x i ,y i ] The pixel positions 100a[x i ,y i -1] and pixel position 100a[x i ,y i +1] The positional relationship between them.

[0173] Please continue to refer to Figure 6 and Fig.10 , according to the horizontal luminance component Lh and horizontal chrominance component of each pixel position 100a, the horizontal luminance components Lh and horizontal chrominance components of multiple pixel positions 100a within a preset uniformity window range centered on each pixel position 100a, and the color difference uniformity threshold eH of each pixel position 100a, the horizontal color difference uniformity parameter homo_h of each pixel position 100a is obtained.

[0174] In this embodiment, the method for obtaining the horizontal color difference uniformity parameter homo_h of each pixel position 100a further includes: obtaining N horizontal luminance color differences ΔEh between the arbitrary pixel position 100a and each pixel position 100a of the N pixel positions 100a according to the horizontal luminance component Lh and the horizontal chrominance component of the arbitrary pixel position 100a, and the horizontal luminance components Lh and the horizontal chrominance components of the N pixel positions 100a within a preset uniformity window range centered on the arbitrary pixel position 100a; comparing the N horizontal luminance color differences ΔEh with the color difference uniformity threshold value eH of the arbitrary pixel position 100a respectively to obtain the number of horizontal uniformity pixels Nh; and obtaining the horizontal color difference uniformity parameter homo_h=Nh / N of the arbitrary pixel position 100a according to the number of horizontal uniformity pixels Nh.

[0175] The number of horizontal uniformity pixels Nh is: the number of horizontal luminance color differences ΔEh that are less than or equal to the color difference uniformity threshold eH of the arbitrary pixel position 100a among the N horizontal luminance color differences ΔEh.

[0176] For ease of understanding, the following will be based on Fig.12 , taking 9 pixel positions 100a within a preset uniformity window of 3*3 pixels as an example, obtaining the horizontal color difference uniformity parameter homo_h of any pixel position 100a is described.

[0177] In addition, for the convenience of explanation, it is assumed that the nine pixel positions 100 a are: pixel position 100 a 1 to pixel position 100 a 9 , wherein the pixel position 100 a 5 is located at the center of the preset uniformity window.

[0178] Please refer to Fig.12, get the horizontal luminance color difference △Eh(a5, a1) between the pixel position 100a5 and the pixel position 100a1, get the horizontal luminance color difference △Eh(a5, a2) between the pixel position 100a5 and the pixel position 100a2, get the horizontal luminance color difference △Eh(a5, a3) between the pixel position 100a5 and the pixel position 100a3, get the horizontal luminance color difference △Eh(a5, a3) between the pixel position 100a5 and the pixel position 100a4, get the horizontal luminance color difference △Eh(a5, a4) between the pixel position 100a5 and the pixel position 100a 5, obtain the horizontal brightness color difference △Eh(a5, a5), obtain the horizontal brightness color difference △Eh(a5, a6) between the pixel position 100a5 and the pixel position 100a6, obtain the horizontal brightness color difference △Eh(a5, a7) between the pixel position 100a5 and the pixel position 100a7, obtain the horizontal brightness color difference △Eh(a5, a8) between the pixel position 100a5 and the pixel position 100a8, obtain the horizontal brightness color difference △Eh(a5, a9) between the pixel position 100a5 and the pixel position 100a9.

[0179] For specific methods of obtaining the horizontal luminance color difference △Eh(a5, a1), the horizontal luminance color difference △Eh(a5, a2), the horizontal luminance color difference △Eh(a5, a3), the horizontal luminance color difference △Eh(a5, a4), the horizontal luminance color difference △Eh(a5, a5), the horizontal luminance color difference △Eh(a5, a6), the horizontal luminance color difference △Eh(a5, a7), the horizontal luminance color difference △Eh(a5, a8), and the horizontal luminance color difference △Eh(a5, a9), please refer to the aforementioned method of obtaining the arbitrary pixel position 100a[x i ,y i ], and another arbitrary pixel position 100a[x j ,y j ] between the horizontal brightness color difference △Eh [xi,yi],[xj,yj] The method will not be described in detail here.

[0180] Please continue to refer to Fig.12, compare the horizontal luminance color difference △Eh(a5, a1), the horizontal luminance color difference △Eh(a5, a2), the horizontal luminance color difference △Eh(a5, a3), the horizontal luminance color difference △Eh(a5, a4), the horizontal luminance color difference △Eh(a5, a5), the horizontal luminance color difference △Eh(a5, a6), the horizontal luminance color difference △Eh(a5, a7), the horizontal luminance color difference △Eh(a5, a8), and the horizontal luminance color difference △Eh(a5, a9) with the color difference uniformity threshold value eH5 of the pixel position 100a5, and obtain the number of horizontal uniformity pixels Nh5; according to the number of horizontal uniformity pixels Nh5, obtain the horizontal color difference uniformity parameter homo_h5=Nh5 / 9 of the pixel position 100a5.

[0181] The horizontal uniformity pixel number Nh5 is: the number of horizontal luminance color difference △Eh(a5, a1), horizontal luminance color difference △Eh(a5, a2), horizontal luminance color difference △Eh(a5, a3), horizontal luminance color difference △Eh(a5, a4), horizontal luminance color difference △Eh(a5, a5), horizontal luminance color difference △Eh(a5, a6), horizontal luminance color difference △Eh(a5, a7), horizontal luminance color difference △Eh(a5, a8), and horizontal luminance color difference △Eh(a5, a9), which is less than or equal to the color difference uniformity threshold eH5 of the pixel position 100a5.

[0182] For example, among the horizontal luminance color difference △Eh(a5, a1), the horizontal luminance color difference △Eh(a5, a2), the horizontal luminance color difference △Eh(a5, a3), the horizontal luminance color difference △Eh(a5, a4), the horizontal luminance color difference △Eh(a5, a5), the horizontal luminance color difference △Eh(a5, a6), the horizontal luminance color difference △Eh(a5, a7), the horizontal luminance color difference △Eh(a5, a8), and the horizontal luminance color difference △Eh(a5, a9), there are 7 that are less than or equal to the color difference uniformity threshold eH5 of the pixel position 100a5, then the number of horizontal uniformity pixels Nh5=7, and accordingly, the horizontal color difference uniformity parameter homo_h5 of the pixel position 100a5=7 / 9.

[0183] Since the N horizontal luminance color differences ΔEh necessarily include: the horizontal luminance color difference ΔEh between the pixel position 100a located at the center of the preset uniformity window and itself, the horizontal color difference uniformity parameter homo_h of any pixel position 100a is greater than 0.

[0184] Therefore, 0<homo_h≤1.

[0185] Please continue to refer to Figure 6 and Fig.10, obtain the vertical color difference uniformity parameter homo_v of each pixel position 100a according to the vertical luminance component Lv and the vertical chrominance component of each pixel position 100a, the vertical luminance component Lv and the vertical chrominance component of multiple pixel positions 100a within a preset uniformity window range centered on each pixel position 100a, and the color difference uniformity threshold eH of each pixel position 100a.

[0186] In this embodiment, the method for obtaining the vertical color difference uniformity parameter of each pixel position 100a further includes: obtaining N vertical luminance color differences ΔEv between the arbitrary pixel position 100a and each pixel position 100a of the N pixel positions 100a according to the vertical luminance component Lv and the vertical chromaticity component of the arbitrary pixel position 100a, and the vertical luminance components Lv and the vertical chromaticity components of the N pixel positions 100a within the preset uniformity window range centered on the arbitrary pixel position 100a; comparing the N vertical luminance color differences ΔEv with the color difference uniformity threshold value eH of the arbitrary pixel position 100a respectively to obtain the vertical uniformity pixel number Nv; and obtaining the vertical color difference uniformity parameter homo_v=Nv / N of the arbitrary pixel position 100a according to the vertical uniformity pixel number Nv.

[0187] The vertical uniformity pixel number Nv is: the number of vertical luminance color difference ΔEv that is less than or equal to the color difference uniformity threshold value eH of the arbitrary pixel position 100a among the N vertical luminance color difference ΔEv.

[0188] For a specific method of obtaining the vertical color difference uniformity parameter homo_v=Nv / N at any pixel position 100a, please refer to Fig.12 The description of the method for obtaining the horizontal color difference uniformity parameter homo_h of any pixel position 100a in the example is for easy understanding and will not be repeated here.

[0189] It is important to understand that although Fig.12 The preset uniformity window in is 3*3 pixels in size, but the preset uniformity window may be selected as any small area centered at the pixel position 100a where the horizontal color difference uniformity parameter homo_h and the vertical color difference uniformity parameter homo_v are to be calculated.

[0190] Similarly, since the N vertical luminance color differences ΔEv necessarily include: the vertical luminance color difference ΔEv between the pixel position 100a located at the center of the preset uniformity window and itself, the vertical color difference uniformity parameter homo_v of any pixel position 100a is greater than 0.

[0191] Therefore, 0<homo_v≤1.

[0192] The horizontal color difference uniformity parameter homo_h at each pixel position 100 a is used to measure the neatness and uniformity of the interpolation result in the horizontal direction X. That is, the neatness and uniformity between the pixel at the pixel position 100 a and the surrounding pixels of the horizontal demosaiced color image 140 .

[0193] Since the pixel position 100a[x i ,y i ] contains the specified level of brightness color difference eH_h [xi,yi] And specify the vertical brightness color difference eH_v [xi,yi] The smaller one is taken as the color difference uniformity threshold eH [xi,yi] Therefore, the N levels of brightness color difference △Eh are respectively compared with the color difference uniformity threshold eH [xi,yi] When making comparisons, it is possible to ensure that △Eh≤eH [xi,yi] The pixel at the pixel position of is the pixel with smaller color difference. Thus, the accuracy of the horizontal color difference uniformity parameter homo_h when measuring the neatness and uniformity of the interpolation result in the horizontal direction X is better ensured.

[0194] In addition, due to the horizontal brightness color difference △Eh [xi,yi],[xi-1,yi] and horizontal brightness color difference △Eh [xi,yi],[xi+1,yi] The larger one is used as the pixel position 100a[x i ,y i ] contains the specified level of brightness color difference eH_h [xi,yi] , therefore, the color difference uniformity threshold eH_h can be reduced [xi,yi] Too small: within the preset uniformity window, the pixel position 100a[x i ,y i ], there are no or very few pixels at the pixel position 100a that can satisfy △Eh≤eH [xi,yi] Thus, the accuracy of the horizontal color difference uniformity parameter homo_h in measuring the neatness and uniformity of the interpolation result in the horizontal direction X is further ensured.

[0195] The vertical color difference uniformity parameter homo_v of each pixel position 100a is used to measure the neatness and uniformity of the interpolation result in the vertical direction Y. That is, the neatness and uniformity between the pixel at the pixel position 100a and the surrounding pixels of the vertical demosaiced color image 180.

[0196] Since the pixel position 100a[x i ,y i ] contains the specified level of brightness color difference eH_h [xi,yi] And specify the vertical brightness color difference eH_v [xi,yi]The smaller one is taken as the color difference uniformity threshold eH [xi,yi] Therefore, the N vertical luminance color difference △Ev are respectively compared with the color difference uniformity threshold eH [xi,yi] When making comparisons, it is possible to ensure that △Ev≤eH [xi,yi] The pixel at the pixel position of is a pixel with smaller color difference. Thus, the accuracy of the vertical color difference uniformity parameter homo_v when measuring the neatness and uniformity of the interpolation result in the vertical direction Y is better ensured.

[0197] In addition, due to the vertical brightness color difference △Ev [xi,yi],[xi,yi-1] And vertical brightness color difference △Ev [xi,yi],[xi,yi+1] The larger one is taken as the pixel position 100a[x i ,y i ] specifies the vertical brightness color difference eH_v [xi,yi] , therefore, the color difference uniformity threshold eH can be reduced [xi,yi] Too small: within the preset uniformity window, the pixel position 100a[x i ,y i ], there are no or very few pixels at the pixel position 100a that can satisfy △Ev≤eH [xi,yi] Thus, the accuracy of the vertical color difference uniformity parameter homo_v in measuring the neatness and uniformity of the interpolation result in the vertical direction Y is further ensured.

[0198] Please refer to Fig.13 According to the size relationship between the horizontal color difference uniformity parameter homo_h and the vertical color difference uniformity parameter homo_v of each pixel position 100a, in the horizontal demosaiced color image 140 or the vertical demosaiced color image 180, the pixel of each pixel position 100a is obtained to form a color image 190.

[0199] In this embodiment, the first interpolation process and the second interpolation process are performed according to the initial white pixels 104 on both sides of each initial color pixel along the horizontal direction X and the initial white pixels 104 on both sides of each initial color pixel along the vertical direction Y, respectively, to obtain a horizontal white pixel interpolation image 110 and a vertical white pixel interpolation image 150, and a horizontal demosaiced color image 140 and a vertical demosaiced color image 180 are formed according to the horizontal white pixel interpolation image 110, the vertical white pixel interpolation image 150, and the mosaic image to be processed 100. Therefore, the horizontal demosaiced color image 140 and the vertical demosaiced color image 180 both contain information of white pixels and information of color pixels.

[0200] On this basis, since the horizontal color difference uniformity parameter homo_h and the vertical color difference uniformity parameter homo_v of each pixel position 100a are obtained according to the horizontal demosaiced color image 140 and the vertical demosaiced color image 180, and according to the size relationship between the horizontal color difference uniformity parameter homo_h and the vertical color difference uniformity parameter homo_v of each pixel position 100a, the pixel of each pixel position 100a is obtained in the horizontal demosaiced color image 140 or the vertical demosaiced color image 180 to form a color image 190, therefore, the information of the white pixel and the color pixel is used at the same time, and the color difference uniformity in the horizontal direction X and the vertical direction Y corresponding to each pixel position 100a is compared, so that when the white pixel interpolation direction with better color difference uniformity is judged for each pixel position 100a, the judgment accuracy of the interpolation direction can be improved. Therefore, a more accurate interpolated pixel at each pixel position 100a can be selected in the horizontal demosaiced color image 140 or the vertical demosaiced color image 180, thereby reducing pseudo colors in the color image 190 and improving the quality of the demosaiced color image.

[0201] Specifically, since the horizontal color difference uniformity parameter homo_h of each pixel position 100a is used to measure the neatness and uniformity of the interpolation result in the horizontal direction X, and the vertical color difference uniformity parameter homo_v of each pixel position 100a is used to measure the neatness and uniformity of the interpolation result in the vertical direction Y, therefore, according to the size relationship between the horizontal color difference uniformity parameter homo_h and the vertical color difference uniformity parameter homo_v of each pixel position 100a, it is possible to determine the one with better color difference uniformity among the pixels at the same pixel position 100a of the horizontal demosaiced color image 140 and the vertical demosaiced color image 180, so that a more accurate interpolated pixel can be selected at each pixel position 100a.

[0202] In this embodiment, according to the size relationship between the horizontal color difference uniformity parameter homo_h and the vertical color difference uniformity parameter homo_v of each pixel position 100a, in the horizontal demosaiced color image 140 or the vertical demosaiced color image 180, the pixel of each pixel position 100a is obtained to form the color image 190, including: when the horizontal color difference uniformity parameter homo_h of any pixel position 100a is greater than or equal to the vertical color difference uniformity parameter homo_v, according to the pixel of the horizontal demosaiced color image 140 at the arbitrary pixel position 100a, the pixel of the arbitrary pixel position 100a is obtained; when the horizontal color difference uniformity parameter homo_h of any pixel position 100a is less than the vertical color difference uniformity parameter homo_v, according to the pixel of the vertical demosaiced color image 180 at the arbitrary pixel position 100a, the pixel of the arbitrary pixel position 100a is obtained.

[0203] Therefore, based on the horizontal color difference uniformity parameter homo_h and the vertical color difference uniformity parameter homo_v in this embodiment, the judgment and acquisition of the one with better color difference uniformity among the pixels at the same pixel position 100a of the horizontal demosaiced color image 140 and the vertical demosaiced color image 180 is achieved to form a color image 190 with less pseudo color.

[0204] It should be understood that, in this embodiment, since the horizontal red pixel channel image 140a, the horizontal green pixel channel image 140b and the horizontal blue pixel channel image 140c are merged to form a horizontal demosaiced color image 140, and the vertical red pixel channel image 180a, the vertical green pixel channel image 180b and the vertical blue pixel channel image 180c are merged to form a vertical demosaiced color image 180, the pixels of the color image 190 at each pixel position 100a include: red pixels, green pixels and blue pixels.

[0205] Similarly, in some other embodiments, since the horizontal red pixel channel image 140a, the horizontal green pixel channel image 140b, the horizontal blue pixel channel image 140c and the horizontal white pixel interpolation image 110 are merged to form a horizontal demosaiced color image, and the vertical red pixel channel image 180a, the vertical green pixel channel image 180b, the vertical blue pixel channel image 180c and the vertical white pixel interpolation image 150 are merged to form a vertical demosaiced color image, the pixels of the color image at each pixel position include: red pixels, green pixels, blue pixels and white pixels.

[0206] In this embodiment, the color image processing method further includes: outputting the color image 190 .

[0207] Fig.14 A color image processing device according to an embodiment of the present invention.

[0208] Accordingly, an embodiment of the present invention further provides a method for implementing Figures 1 to 13 The color image processing method and the color image processing device in the embodiment described above are combined with Figures 1 to 13 refer to Fig.14 The color image processing device 500 includes: a color image sensor 510, used to obtain a mosaic image 100 to be processed, wherein the mosaic image 100 to be processed includes a plurality of initial white pixels 104 and a plurality of initial color pixels arranged in a two-dimensional array at a plurality of pixel positions 100a; a de-mosaicing unit 520, used to perform de-mosaicing on the mosaic image 100 to be processed to obtain a color image 190.

[0209] The following is a detailed description with reference to the accompanying drawings.

[0210] Please continue to refer to Fig.14 The de-mosaic processing unit 520 includes: a first interpolation processing module 521, which is used to perform a first interpolation processing on the pixel position 100a where each initial color pixel is located according to the initial white pixels 104 on both sides of each initial color pixel along the horizontal direction X, and obtain a horizontal white pixel interpolation image 110.

[0211] In this embodiment, the first interpolation process includes: according to the horizontal direction X, i The pixel values ​​T1 of the two adjacent initial white pixels 104 are i and pixel value T2 i , obtain the initial color pixel C i Pixel location 100a i The horizontal white pixel interpolation Th i =(T1 i +T2 i ) / 2.

[0212] Please continue to refer to Fig.14 The demosaic processing unit 520 further includes: a horizontal demosaic color image acquisition unit 522, which is used to acquire a horizontal demosaic color image 140 according to the horizontal white pixel interpolation image 110 and the mosaic image 100 to be processed.

[0213] Please refer to Fig.15 , Fig.151 is a schematic diagram of the structure of a horizontal demosaic color image acquisition unit according to an embodiment of the present invention, wherein the horizontal demosaic color image acquisition unit 522 comprises: a horizontal intermediate to-be-processed mosaic image acquisition module 5221, configured to perform pixel value subtraction processing at pixel position 100a on the to-be-processed mosaic image 100 and the horizontal white pixel interpolation image 110, to acquire a horizontal intermediate to-be-processed mosaic image 120; an initial horizontal demosaic red pixel channel image acquisition module 5222a, configured to perform pixel value subtraction processing at pixel position 100a on the to-be-processed mosaic image 100 and the horizontal white pixel interpolation image 110, to acquire a horizontal intermediate to-be-processed mosaic image 120; The first pixel channel image 120 is subjected to a third interpolation process to obtain an initial horizontal demosaiced red pixel channel image 130a; the first pixel channel image acquisition module 5222b is used to perform a fourth interpolation process on the horizontal intermediate mosaic image 120 to be processed according to the plurality of horizontal intermediate green pixels 122 to obtain an initial horizontal demosaiced green pixel channel image 130b; the first pixel channel image acquisition module 5222c is used to perform a fourth interpolation process on the horizontal intermediate mosaic image 120 to be processed according to the plurality of horizontal intermediate blue pixels 123 to obtain an initial horizontal demosaiced green pixel channel image 130b; 5. Interpolation processing to obtain an initial horizontal demosaiced blue pixel channel image 130c; a horizontal red pixel channel image acquisition module 5223a, used to perform pixel-by-pixel position 100a addition processing on the horizontal white pixel interpolation image 110 and the initial horizontal demosaiced red pixel channel image 130a to obtain a horizontal red pixel channel image 140a; a horizontal green pixel channel image acquisition module 5223b, used to perform pixel-by-pixel position 100a addition processing on the horizontal white pixel interpolation image 110 and the initial horizontal demosaiced green pixel channel image 130b Addition processing is performed to obtain a horizontal green pixel channel image 140b; a horizontal blue pixel channel image acquisition module 5223c is used to perform addition processing on the horizontal white pixel interpolation image 110 and the initial horizontal demosaiced blue pixel channel image 130c at a pixel position 100a to obtain a horizontal blue pixel channel image 140c; a horizontal merging module 5224 is used to merge the horizontal red pixel channel image 140a, the horizontal green pixel channel image 140b and the horizontal blue pixel channel image 140c to form a horizontal demosaiced color image 140.

[0214] In some other embodiments, the horizontal merging module is used to merge the horizontal red pixel channel image 140a, the horizontal green pixel channel image 140b, the horizontal blue pixel channel image 140c and the horizontal white pixel interpolation image 110 to form a horizontal demosaiced color image.

[0215] Please continue to refer to Fig.14The de-mosaic processing unit 520 also includes: a second interpolation processing module 523, which is used to perform a second interpolation processing on the pixel position 100a where each initial color pixel is located according to the initial white pixels 104 on both sides of each initial color pixel along the vertical direction Y to obtain a vertical white pixel interpolation image 150.

[0216] In this embodiment, the second interpolation process includes: according to the vertical direction Y, i The pixel value T3 of the two adjacent initial white pixels 104 i and pixel value T4 i , obtain the initial color pixel C i Pixel location 100a i Vertical white pixel interpolation Tv i =(T3 i +T4 i ) / 2.

[0217] Please continue to refer to Fig.14 The demosaic processing unit 520 further includes: a vertical demosaic color image acquisition unit 524, which is used to acquire a vertical demosaic color image 180 according to the vertical white pixel interpolation image 150 and the mosaic image 100 to be processed.

[0218] Please refer to Fig.16 , Fig.161 is a schematic diagram of the structure of a vertical demosaic color image acquisition unit according to an embodiment of the present invention, wherein the vertical demosaic color image acquisition unit 524 comprises: a vertical intermediate to-be-processed mosaic image acquisition module 5241, configured to perform pixel value subtraction processing at pixel position 100a on the to-be-processed mosaic image 100 and the vertical white pixel interpolation image 150, to acquire a vertical intermediate to-be-processed mosaic image 160; an initial vertical demosaic red pixel channel image acquisition module 5242a, configured to obtain a vertical intermediate to-be-processed mosaic image 160 according to a plurality of vertical intermediate red pixels 161; The sixth interpolation processing is performed on the mosaic image 160 to obtain an initial vertical demosaiced red pixel channel image 170a; the initial vertical demosaiced green pixel channel image acquisition module 5242b is used to perform a seventh interpolation processing on the vertical intermediate mosaic image 160 to be processed according to a plurality of vertical intermediate green pixels 162 to obtain an initial vertical demosaiced green pixel channel image 170b; the initial vertical demosaiced blue pixel channel image acquisition module 5242c is used to perform a seventh interpolation processing on the vertical intermediate mosaic image 160 to be processed according to a plurality of vertical intermediate blue pixels 163 8. Interpolation processing to obtain an initial vertical demosaiced blue pixel channel image 170c; a vertical red pixel channel image acquisition module 5243a, used to perform pixel-by-pixel position 100a addition processing on the vertical white pixel interpolation image 150 and the initial vertical demosaiced red pixel channel image 170a to obtain a vertical red pixel channel image 180a; a vertical green pixel channel image acquisition module 5243b, used to perform pixel-by-pixel position 100a addition processing on the vertical white pixel interpolation image 150 and the initial vertical demosaiced green pixel channel image 170b Addition processing is performed to obtain a vertical green pixel channel image 180b; a vertical blue pixel channel image acquisition module 5243c is used to perform addition processing on the vertical white pixel interpolation image 150 and the initial vertical demosaiced blue pixel channel image 170c at a pixel position 100a to obtain a vertical blue pixel channel image 180c; a vertical merging module 5244 is used to merge the vertical red pixel channel image 180a, the vertical green pixel channel image 180b and the vertical blue pixel channel image 180c to form a vertical demosaiced color image 180.

[0219] In some other embodiments, the vertical merging module is used to merge the vertical red pixel channel image 180a, the vertical green pixel channel image 180b, the vertical blue pixel channel image 180c and the vertical white pixel interpolation image 150 to form a vertical demosaiced color image.

[0220] Please continue to refer to Fig.14The demosaic processing unit 520 further includes: a color difference uniformity parameter acquisition unit 525, which is used to acquire a horizontal color difference uniformity parameter homo_h and a vertical color difference uniformity parameter homo_v of each pixel position 100a according to the horizontal demosaic color image 140 and the vertical demosaic color image 180.

[0221] Please refer to Fig.17 , Fig.17 1 is a structural schematic diagram of a color difference uniformity parameter acquisition unit according to an embodiment of the present invention. The color difference uniformity parameter acquisition unit 525 includes: a color space conversion module 5251, which is used to perform color space conversion on the horizontal demosaiced color image 140 to obtain the horizontal brightness component Lh and the horizontal chrominance component of each pixel position 100a, and to perform color space conversion on the vertical demosaiced color image 140 to obtain the vertical brightness component Lv and the vertical chrominance component of each pixel position 100a.

[0222] In this embodiment, the horizontal chrominance component of each pixel position 100a includes: a first horizontal chrominance component Ah and a second horizontal chrominance component Bh.

[0223] In this embodiment, the vertical chromaticity components of each pixel position 100a include: a first vertical chromaticity component Av and a second vertical chromaticity component Bv.

[0224] Please continue to refer to Fig.17 The color difference uniformity parameter acquisition unit 525 also includes: a color difference uniformity threshold acquisition unit 5252, which is used to acquire a color difference uniformity threshold eH of each pixel position 100a according to the horizontal brightness component Lh and the horizontal chromaticity component of the pixel position 100a on both sides of each pixel position 100a along the horizontal direction X, the vertical brightness component Lv and the vertical chromaticity component of the pixel position 100a on both sides of each pixel position 100a along the vertical direction Y, and the horizontal brightness component Lh, horizontal chromaticity component, vertical brightness component Lv and vertical chromaticity component of each pixel position 100a.

[0225] Please refer to Fig.18 , Fig.18 1 is a schematic diagram of the structure of a color difference uniformity threshold acquisition unit according to an embodiment of the present invention, wherein the color difference uniformity threshold acquisition unit 5252 comprises: a designated horizontal luminance color difference acquisition unit 5252a, configured to acquire a designated horizontal luminance color difference eH_h of the pixel position 100a[xi,yi] according to the horizontal luminance component Lh, the first horizontal chrominance component and the second horizontal chrominance component of the pixel position 100a[xi,yi] and the pixel position 100a[xi-1,yi] and the pixel position 100a[xi+1,yi] on both sides of the pixel position 100a[xi,yi] along the horizontal direction X.[xi,yi] .

[0226] In this embodiment, the designated horizontal luminance color difference acquisition unit 5252a includes: a first horizontal luminance color difference acquisition module (not shown) for acquiring the horizontal luminance color difference ΔEh between the pixel position 100a[xi,yi] and the pixel position 100a[xi-1,yi] according to the horizontal luminance component Lv, the first horizontal chromaticity component Ah and the second horizontal chromaticity component Bh of the pixel position 100a[xi,yi] and the pixel position 100a[xi-1,yi]. [xi,yi],[xi-1,yi] The second level contains a brightness and color difference acquisition module (not shown), which is used to obtain the color difference according to the pixel position 100a[x i ,y i ] and pixel position 100a[x i +1,y i ], the horizontal luminance component Lv, the first horizontal chrominance component Ah and the second horizontal chrominance component Bh, and the pixel position 100a[x i ,y i ] and pixel position 100a[x i +1,y i ] between the horizontal brightness color difference △Eh [xi,yi],[xi+1,yi] ; Specify the horizontal brightness color difference acquisition module (not shown), which is used to obtain the horizontal brightness color difference △Eh [xi,yi],[xi-1,yi] and horizontal brightness color difference △Eh [xi,yi],[xi+1,yi] , get the pixel position [x i ,y i ] contains the specified level of brightness color difference eH_h [xi,yi] =max(ΔEh [xi,yi],[xi-1,yi] ,ΔEh [xi,yi],[xi+1,yi] ).

[0227] Please continue to refer to Fig.18 The color difference uniformity threshold acquisition unit 5252 also includes: a specified vertical luminance color difference acquisition unit 5252b, which is used to acquire the specified vertical luminance color difference eH_v of the pixel position 100a[xi,yi] according to the vertical luminance component Lv, the first vertical chromaticity component and the second vertical chromaticity component of the pixel position 100a[xi,yi] on both sides of the pixel position 100a[xi,yi] along the vertical direction Y, the pixel position 100a[xi,yi-1] and the pixel position 100a[xi,yi+1] [xi,yi] .

[0228] In this embodiment, the designated vertical luminance color difference acquisition unit 5252b includes: a first vertical luminance color difference acquisition module (not shown) for acquiring a luminance color difference according to the pixel position 100a[x i ,y i] and pixel position 100a[x i ,y i -1], the vertical luminance component Lv, the first vertical chrominance component Av and the second vertical chrominance component Bv, and obtain the pixel position 100a[x i ,y i ] and pixel position 100a[x i ,y i -1] between the vertical brightness color difference △Ev [xi,yi],[xi,yi-1] The second vertical brightness color difference acquisition module (not shown) is used to obtain the brightness color difference according to the pixel position 100a[x i ,y i ] and pixel position 100a[x i ,y i +1], the vertical luminance component Lv, the first vertical chrominance component Av and the second vertical chrominance component Bv, and obtain the pixel position 100a[x i ,y i ] and pixel position 100a[x i ,y i +1] between the vertical brightness color difference △Ev [xi,yi],[xi,yi+1] ; Specify the vertical brightness color difference acquisition module (not shown) for obtaining the vertical brightness color difference △Ev [xi,yi],[xi,yi-1] And vertical brightness color difference △Ev [xi,yi],[xi,yi+1] , get the pixel position 100a[x i ,y i ] specifies the vertical brightness color difference eH_v [xi,yi] =max(ΔEv [xi,yi],[xi,yi-1] ,ΔEv [xi,yi],[xi,yi+1] ).

[0229] Please continue to refer to Fig.18 The color difference uniformity threshold acquisition unit 5252 further includes: a color difference uniformity threshold acquisition module 5252c, which is used to compare the specified level of brightness color difference eH_h [xi,yi] and the specified vertical luminance color difference eH_v [xi,yi] , get the pixel position 100a[x i ,y i ] color difference uniformity threshold eH [xi,yi] =min(eH_h [xi,yi] ,eH_v [xi,yi] ).

[0230] Please continue to refer to Fig.17The color difference uniformity parameter acquisition unit 525 also includes: a horizontal color difference uniformity parameter acquisition module 5253, which is used to acquire the horizontal color difference uniformity parameter homo_h of each pixel position 100a according to the horizontal brightness component Lh and the horizontal chromaticity component of each pixel position 100a, the horizontal brightness components Lh and the horizontal chromaticity components of multiple pixel positions 100a within a preset uniformity window range centered on each pixel position 100a, and the color difference uniformity threshold eH of each pixel position 100a.

[0231] Specifically, the horizontal color difference uniformity parameter acquisition module 5253 in this embodiment is used to: acquire N horizontal luminance color differences ΔEh between the arbitrary pixel position 100a and each pixel position 100a in the N pixel positions 100a according to the horizontal luminance component Lh and the horizontal chrominance component of the arbitrary pixel position 100a, and the horizontal luminance components Lh and the horizontal chrominance components of the N pixel positions 100a within the preset uniformity window range centered on the arbitrary pixel position 100a; and, compare the N horizontal luminance color differences ΔEh with the color difference uniformity threshold value eH of the arbitrary pixel position 100a respectively to acquire the number of horizontal uniformity pixels Nh; and, according to the number of horizontal uniformity pixels Nh, acquire the horizontal color difference uniformity parameter homo_h=Nh / N of the arbitrary pixel position 100a.

[0232] Please continue to refer to Fig.17 The color difference uniformity parameter acquisition unit 525 also includes: a vertical color difference uniformity parameter acquisition module 5254, which is used to acquire the vertical color difference uniformity parameter homo_v of each pixel position 100a according to the vertical brightness component Lv and the vertical chromaticity component of each pixel position 100a, the vertical brightness component Lv and the vertical chromaticity component of multiple pixel positions 100a within a preset uniformity window range centered on each pixel position 100a, and the color difference uniformity threshold eH of each pixel position 100a.

[0233] Specifically, the vertical color difference uniformity parameter acquisition module 5254 in this embodiment is used to: acquire N vertical luminance color differences ΔEv between the arbitrary pixel position 100a and each pixel position 100a of the N pixel positions 100a according to the vertical luminance component Lv and the vertical chrominance component of the arbitrary pixel position 100a, and the vertical luminance components Lv and the vertical chrominance components of the N pixel positions 100a within the preset uniformity window range centered on the arbitrary pixel position 100a; compare the N vertical luminance color differences ΔEv with the color difference uniformity threshold value eH of the arbitrary pixel position 100a respectively to acquire the vertical uniformity pixel number Nv; and acquire the vertical color difference uniformity parameter homo_v=Nv / N of the arbitrary pixel position 100a according to the vertical uniformity pixel number Nv.

[0234] Please continue to refer to Fig.14 The demosaic processing unit 520 also includes: a color image acquisition unit 526, which is used to acquire the pixel of each pixel position 100a in the horizontal demosaic color image 140 or the vertical demosaic color image 180 according to the size relationship between the horizontal color difference uniformity parameter homo_h and the vertical color difference uniformity parameter homo_v of each pixel position 100a to form a color image 190.

[0235] Specifically, the color image acquisition unit 526 in this embodiment is used to: when the horizontal color difference uniformity parameter homo_h of any pixel position 100a is greater than or equal to the vertical color difference uniformity parameter homo_v, acquire the pixel of the arbitrary pixel position 100a according to the pixel of the horizontal demosaiced color image 140 at the arbitrary pixel position 100a; and when the horizontal color difference uniformity parameter homo_h of any pixel position 100a is less than the vertical color difference uniformity parameter homo_v, acquire the pixel of the arbitrary pixel position 100a according to the pixel of the vertical demosaiced color image 180 at the arbitrary pixel position 100a.

[0236] Those skilled in the art should understand that the color image processing device 500 provided in this embodiment is Figures 1 to 13 The color image processing method provided in the embodiment shown in the figure is complementary to each other in terms of specific implementation principle and logic. Figures 1 to 13 The relevant description in the illustrated embodiment will not be repeated here.

[0237] In this embodiment, the color image processing apparatus 500 further includes: an image output unit 530 , configured to output the color image 130 .

[0238] Fig.19It is a flowchart of a color image processing method according to another embodiment of the present invention.

[0239] Please refer to Fig.19 , the color image processing method comprises:

[0240] Step S100, obtaining a mosaic image to be processed, wherein the mosaic image to be processed includes a plurality of initial white pixels and a plurality of initial color pixels arranged in a two-dimensional array at a plurality of pixel positions;

[0241] Step S200, performing pixel value uniformity processing on the mosaic image to be processed to obtain an adjusted mosaic image;

[0242] Step S300, performing a first interpolation process on the pixel position where each initial color pixel is located according to initial white pixels on both sides of each initial color pixel along the horizontal direction, to obtain a horizontal white pixel interpolation image;

[0243] Step S400, obtaining a horizontal demosaiced color image according to the horizontal white pixel interpolation image and the mosaic image to be processed;

[0244] Step S500, performing a second interpolation process on the pixel position where each initial color pixel is located according to initial white pixels on both sides of each initial color pixel along the vertical direction, to obtain a vertical white pixel interpolation image;

[0245] Step S600, obtaining a vertical demosaiced color image according to the vertical white pixel interpolation image and the mosaic image to be processed;

[0246] Step S700, acquiring a horizontal color difference uniformity parameter and a vertical color difference uniformity parameter of each pixel position according to the horizontal demosaiced color image and the vertical demosaiced color image;

[0247] Step S800, according to the magnitude relationship between the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position, in the horizontal demosaiced color image or the vertical demosaiced color image, a pixel at each pixel position is obtained to form a color image;

[0248] Step S900, performing restoration processing on the color image to form a restored color image.

[0249] Figures 20 to 32 It is a structural schematic diagram of each step of an image processing method according to another embodiment of the present invention.

[0250] Please refer to Fig. 20 , obtaining a mosaic image 200 to be processed, wherein the mosaic image 200 to be processed includes a plurality of initial white pixels 204 and a plurality of initial color pixels arranged in a two-dimensional array at a plurality of pixel positions 200a.

[0251] In this embodiment, the plurality of initial color pixels include a plurality of initial red pixels 201 , a plurality of initial green pixels 202 , and a plurality of initial blue pixels 203 .

[0252] It should be noted that, for ease of understanding, Figure 2 A pixel position 200a is schematically indicated by a dotted line.

[0253] Specifically, in the horizontal direction X, the initial white pixels 204 and the initial color pixels are arranged alternately, and in the vertical direction Y, the initial white pixels 204 and the initial color pixels are arranged alternately.

[0254] Accordingly, the number of the initial white pixels 204 accounts for 50% of the total number of pixels of the mosaic image 200 to be processed.

[0255] In addition, in the horizontal direction X, the initial red pixel 201, the initial green pixel 202 and the initial blue pixel 203 are periodically arranged alternately, and in the vertical direction Y, the initial red pixel 201, the initial green pixel 202 and the initial blue pixel 203 are periodically arranged alternately.

[0256] It should be noted that the mosaic image 200 to be processed is an original image captured by a single color image sensor, and is a mosaic image that is consistent with the arrangement of the color filter array installed on the color image sensor. The mosaic image 200 to be processed must be de-mosaiced to generate a color image that can be used for viewing.

[0257] Please refer to Fig.21 , performing pixel value uniformity processing on the mosaic image 200 to be processed to obtain an adjusted mosaic image 210.

[0258] The adjusted mosaic image 210 includes a plurality of adjusted white pixels 214 and a plurality of adjusted color pixels arranged in a two-dimensional array at a plurality of pixel positions 200 a.

[0259] The plurality of adjusted color pixels include: a plurality of adjusted red pixels 211 , a plurality of adjusted green pixels 212 , and a plurality of adjusted blue pixels 213 .

[0260] The average pixel value meanR′ of the plurality of adjusted red pixels 211 , the average pixel value meanG′ of the plurality of adjusted green pixels 212 , the average pixel value meanB′ of the plurality of adjusted blue pixels 213 , and the average pixel value meanW′ of the plurality of adjusted white pixels 214 are equal.

[0261] Specifically, meanR'=meanG'=meanB'=meanW'.

[0262] It should be noted that the average pixel value meanR′ of the multiple adjusted red pixels 211 refers to: the pixel value obtained by adding the pixel values ​​R′ of all the adjusted red pixels 211 in the adjusted mosaic image 210 and dividing the sum by the number of all the adjusted red pixels 211 .

[0263] Similarly, the average pixel value meanG′ of the plurality of adjusted green pixels 212 refers to a pixel value obtained by adding the pixel values ​​G′ of all the adjusted green pixels 212 in the adjusted mosaic image 210 and dividing the sum by the number of all the adjusted green pixels 212 .

[0264] Similarly, the average pixel value meanB′ of the plurality of adjusted blue pixels 213 refers to a pixel value obtained by adding the pixel values ​​B′ of all the adjusted blue pixels 213 in the adjusted mosaic image 210 and dividing the sum by the number of all the adjusted blue pixels 213 .

[0265] Similarly, the average pixel value meanW′ of the plurality of adjusted white pixels 214 refers to a pixel value obtained by adding the pixel values ​​W′ of all the adjusted white pixels 214 in the adjusted mosaic image 210 and dividing the sum by the number of all the adjusted white pixels 214 .

[0266] In this embodiment, pixel value uniformity processing is performed on the mosaic image to be processed 200, and a method for obtaining an adjusted mosaic image 210 includes: obtaining an average pixel value meanR of the multiple initial red pixels 201; obtaining an average pixel value meanG of the multiple initial green pixels 202; obtaining an average pixel value meanB of the multiple initial blue pixels 203; obtaining an average pixel value meanW of the multiple initial white pixels 204; and obtaining a first adjustment coefficient coefR and a second adjustment coefficient coefR according to the average pixel value meanR, the average pixel value meanG, the average pixel value meanB and the average pixel value meanW. coefG, a third adjustment coefficient coefB and a fourth adjustment coefficient coefW; adjusting the pixel value R of each initial red pixel 201 according to the first adjustment coefficient coefR to form a corresponding adjusted red pixel 211; adjusting the pixel value G of each initial green pixel 202 according to the second adjustment coefficient coefG to form a corresponding adjusted green pixel 212; adjusting the pixel value B of each initial blue pixel 203 according to the third adjustment coefficient coefB to form a corresponding adjusted blue pixel 213; adjusting the pixel value W of each initial white pixel 204 according to the fourth adjustment coefficient coefW to form a corresponding adjusted white pixel 214.

[0267] Specifically, the method for obtaining the average pixel value meanR of the plurality of initial red pixels 201 is: dividing the sum of the pixel values ​​R of all the initial red pixels 201 in the mosaic image 200 to be processed by the number of all the initial red pixels 201 .

[0268] Similarly, the method for obtaining the average pixel value meanG of the multiple initial green pixels 202 is: dividing the sum of the pixel values ​​G of all the initial green pixels 202 in the mosaic image 200 to be processed by the number of all the initial green pixels 202 .

[0269] Similarly, the method for obtaining the average pixel value meanB of the multiple initial blue pixels 203 is: dividing the sum of the pixel values ​​B of all the initial blue pixels 203 in the mosaic image 200 to be processed by the number of all the initial blue pixels 203 .

[0270] Similarly, the method for obtaining the average pixel value meanW of the multiple initial white pixels 204 is: dividing the sum of the pixel values ​​W of all the initial white pixels 204 in the mosaic image 200 to be processed by the number of all the initial white pixels 204 .

[0271] In this embodiment, the method for obtaining the first adjustment coefficient coefR, the second adjustment coefficient coefG, the third adjustment coefficient coefB and the fourth adjustment coefficient coefW according to the average pixel value meanR, the average pixel value meanG, the average pixel value meanB and the average pixel value meanW includes: setting the average pixel value meanR, the average pixel value meanG, the average pixel value meanB, or the average pixel value meanW as the target average value meanT; dividing the target average value meanT by the average pixel value meanR to obtain the first adjustment coefficient coefR; dividing the target average value meanT by the average pixel value meanG to obtain the second adjustment coefficient coefG; dividing the target average value meanT by the average pixel value meanB to obtain the third adjustment coefficient coefB; dividing the target average value meanT by the average pixel value meanW to obtain the fourth adjustment coefficient coefW.

[0272] Since the average pixel value meanR, the average pixel value meanG, the average pixel value meanB, or the average pixel value meanW is set to the target average value meanT, at least one of the first adjustment coefficient coefR, the second adjustment coefficient coefG, the third adjustment coefficient coefB and the fourth adjustment coefficient coefW is 1.

[0273] For ease of understanding, assume that the average pixel value meanW is the target average value meanT for example: coefW=meanW / meanW, coefR=meanW / meanR, coefG=meanW / meanG, and coefB=meanW / meanB.

[0274] In this embodiment, the pixel value R of each initial red pixel 201 is adjusted according to the first adjustment coefficient coefR to form a pixel value R′=coefR×R of the corresponding adjusted red pixel 211 .

[0275] Similarly, the pixel value G of each initial green pixel 202 is adjusted according to the second adjustment coefficient coefG to form a corresponding adjusted green pixel 212 with pixel G′=coefG×G.

[0276] Similarly, the pixel value B of each initial blue pixel 203 is adjusted according to the third adjustment coefficient coefB to form a pixel value B′=coefB×B of the corresponding adjusted blue pixel 213 .

[0277] Similarly, the pixel value W of each initial white pixel 204 is adjusted according to the fourth adjustment coefficient coefW to form a pixel value W′=coefW×W of the corresponding adjusted white pixel 214 .

[0278] Thus, the acquisition of the adjusted mosaic image 210 in which the average pixel value meanR' of multiple adjusted red pixels 211, the average pixel value meanG' of multiple adjusted green pixels 212, the average pixel value meanB' of multiple adjusted blue pixels 213, and the average pixel value meanW' of multiple adjusted white pixels 214 are equal is achieved.

[0279] Please combine Fig. 20 and Fig.21 refer to Fig. 22 According to the initial white pixels 204 on both sides of each initial color pixel along the horizontal direction X, a first interpolation process is performed on the pixel position 200a where each initial color pixel is located to obtain a horizontal white pixel interpolation image 220.

[0280] In this embodiment, the method for performing the first interpolation processing on the pixel position 200a where each initial color pixel is located according to the initial white pixels 204 on both sides of each initial color pixel along the horizontal direction X comprises: i (like Fig. 20 ) The pixel values ​​W1 of the two adjusted white pixels 214 corresponding to the two adjacent initial white pixels 204 are shown in FIG. i and pixel value W2 i , obtain the initial color pixel Ci The horizontal white pixel interpolation Wh at pixel position 200a i =(W1 i +W2 i ) / 2; with the initial color pixel C i The horizontal white pixel interpolation Wh at pixel position 200a i , interpolating to the same pixel position 200a in the adjusted mosaic image 210.

[0281] Specifically, in the horizontal direction X, any initial color pixel C i The two adjusted white pixels 214 corresponding to the two adjacent initial white pixels 204 refer to: i (like Fig.21 2 adjacent adjusted white pixels 214 as shown).

[0282] The adjustment color pixel D i Refers to: any initial color pixel C in the mosaic image 200 to be processed i Adjusted color pixels in the adjusted mosaic image 210 at the same pixel location 200a.

[0283] Specifically, after the first interpolation process, the horizontal white pixel interpolation image 220 includes: a plurality of adjusted white pixels 214 and a plurality of horizontal interpolated white pixels 224. i The pixel value of the horizontal interpolated white pixel 224 is Wh i =(W1 i +W2 i Furthermore, the plurality of adjusted white pixels 214 and the plurality of horizontal interpolated white pixels 224 are arranged at intervals in both the horizontal direction X and the vertical direction Y.

[0284] Next, according to the horizontal white pixel interpolation image 220 and the mosaic image to be processed 200, a horizontal demosaic color image 250 (eg Fig.25 shown).

[0285] Specifically, since the adjusted mosaic image 210 is obtained based on the mosaic image 200 to be processed, in this embodiment, the method for obtaining the horizontal demosaiced color image 250 based on the horizontal white pixel interpolation image 220 and the mosaic image 200 to be processed further includes: obtaining the horizontal demosaiced color image 250 based on the horizontal white pixel interpolation image 220 and the adjusted mosaic image 210.

[0286] For specific steps of obtaining the horizontal demosaiced color image 250, please refer to Figure 23 to Figure 25 .

[0287] Please refer to Fig.23 , a pixel value subtraction process is performed on the adjusted mosaic image 210 and the horizontal white pixel interpolation image 220 at each pixel position 200 a to obtain a horizontal slowly varying mosaic image 230 .

[0288] The horizontally slowly changing mosaic image 230 includes: a plurality of horizontally slowly changing red pixels 231 located at the same pixel position 200a as the plurality of adjusted red pixels 211, a plurality of horizontally slowly changing green pixels 232 located at the same pixel position 200a as the plurality of adjusted green pixels 212, and a plurality of horizontally slowly changing blue pixels 233 located at the same pixel position 200a as the plurality of adjusted blue pixels 213.

[0289] Specifically, the pixel value R'1h of any horizontally slowly changing red pixel 231 is equal to R'-Wh, wherein R' refers to the pixel value of the adjusted red pixel 211 at the same pixel position 200a as the arbitrary horizontally slowly changing red pixel 231; and Wh refers to the pixel value of the horizontally interpolated white pixel 224 at the same pixel position 200a as the arbitrary horizontally slowly changing red pixel 231.

[0290] Similarly, the pixel value G'1h=G'-Wh of any horizontally gradually changing green pixel 232, wherein G' refers to the pixel value of the adjusted green pixel 212 at the same pixel position 200a as the arbitrary horizontally gradually changing green pixel 232; and Wh refers to the pixel value of the horizontally interpolated white pixel 224 at the same pixel position 200a as the arbitrary horizontally gradually changing green pixel 232.

[0291] Similarly, the pixel value B'1h=B'-Wh of any horizontally gradually changing blue pixel 233, wherein B' refers to the pixel value of the adjusted blue pixel 213 at the same pixel position 200a as the arbitrary horizontally gradually changing blue pixel 233; and Wh refers to the pixel value of the horizontally interpolated white pixel 224 at the same pixel position 200a as the arbitrary horizontally gradually changing blue pixel 233.

[0292] Similarly, the pixel position 100a where the white pixel 214 is located is arbitrarily adjusted, and the corresponding pixel value in the horizontally slowly changing mosaic image 230 is 0 (eg Fig.23 shown).

[0293] Please refer to Fig.24 According to the multiple horizontal slowly changing red pixels 231, a third interpolation process is performed on the horizontal slowly changing mosaic image 230 to obtain a horizontal slowly changing red pixel channel image 240a, wherein each pixel position 200a of the horizontal slowly changing red pixel channel image 240a has one initial horizontal red pixel 241.

[0294] The third interpolation processing method includes: bilinear interpolation processing, bicubic interpolation processing, mean filter interpolation processing or median filter interpolation processing.

[0295] For ease of understanding, the third interpolation process as mean filtering is taken as an example to illustrate the working method of obtaining the horizontal slowly varying red pixel channel image 240a.

[0296] Specifically, the method for obtaining the horizontal slowly varying red pixel channel image 240a includes: providing a filter window of a preset size; based on the horizontal slowly varying mosaic image 230, traversing each pixel position 200a with the filter window to obtain the initial horizontal red pixel 241 of each pixel position 200a.

[0297] The filter window of the preset size is, for example, a filter window of a size of 9*9 pixels.

[0298] Specifically, when the filter window traverses to any pixel position 200a i When the arbitrary pixel position 200a is obtained i The method of setting the initial horizontal red pixel 241 includes: making the arbitrary pixel position 100a i Located at the center of the filter window; according to the total pixel value ∑R'1h of all horizontally slowly changing red pixels 231 within the current range of the filter window, and the total number S of horizontally slowly changing red pixels 231 within the current range of the filter window R , obtain the arbitrary pixel position 200a i The pixel value of the initial horizontal red pixel 241 is mR'1h=(∑R'1h) / S R .

[0299] Thus, the pixel value mR'1h of the initial horizontal red pixel 241 at each pixel position 200a is obtained to form the horizontal slowly varying red pixel channel image 240a.

[0300] Please continue to refer to Fig.24 According to the multiple horizontal slowly varying green pixels 232, a fourth interpolation process is performed on the horizontal slowly varying mosaic image 230 to obtain a horizontal slowly varying green pixel channel image 240b, wherein each pixel position 200a of the horizontal slowly varying green pixel channel image 240b has one initial horizontal green pixel 242.

[0301] The fourth interpolation processing method includes: bilinear interpolation processing, bicubic interpolation processing, mean filter interpolation processing or median filter interpolation processing.

[0302] Similarly, through the fourth interpolation process, the pixel value mG'1h of the initial horizontal green pixel 242 at each pixel position 200a is obtained to form the horizontal slowly varying green pixel channel image 240b.

[0303] Please continue to refer to Fig.24 According to the multiple horizontal slowly varying blue pixels 233 , a fifth interpolation process is performed on the horizontal slowly varying mosaic image 230 to obtain a horizontal slowly varying blue pixel channel image 240c , wherein each pixel position 200a of the horizontal slowly varying blue pixel channel image 240c has one initial horizontal blue pixel 243 .

[0304] The fifth interpolation processing method includes: bilinear interpolation processing, bicubic interpolation processing, mean filter interpolation processing or median filter interpolation processing.

[0305] Similarly, through the fifth interpolation process, the pixel value mB'1h of the initial horizontal blue pixel 243 at each pixel position 200a is obtained to form the horizontally gradually varying blue pixel channel image 240c.

[0306] In this embodiment, the third interpolation process, the fourth interpolation process and the fifth interpolation process are performed in the same manner, so that the relative deviation between the horizontally slowly changing red pixel channel image 240a, the horizontally slowly changing green pixel channel image 240b and the horizontally slowly changing blue pixel channel image 240c can be reduced, further improving the quality of the restored color image.

[0307] The specific working methods of the fourth interpolation processing and the fifth interpolation processing can refer to the example description of the working method of the third interpolation processing in this embodiment, which will not be repeated here.

[0308] Please refer to Fig.25 , the horizontal white pixel interpolation image 220 and the horizontal slowly varying red pixel channel image 240a are added pixel by pixel at position 200a to obtain a horizontal red pixel channel image 250a.

[0309] Specifically, in the horizontal red pixel channel image 250a, any pixel position 200a i The pixel value R'2h of the horizontal red pixel 251 i =mR'1h i +Wh i , wherein the mR'1h i is the arbitrary pixel position 100a i The initial horizontal pixel value of the red pixel 241, the Wh i The horizontal white pixel interpolation image 220 at the arbitrary pixel position 100a i The pixel value of .

[0310] Please continue to refer to Fig.25 , the horizontal white pixel interpolation image 220 and the horizontal slowly varying green pixel channel image 240b are added pixel by pixel at position 200a to obtain a horizontal green pixel channel image 250b.

[0311] Specifically, in the horizontal green pixel channel image 250b, any pixel position 200a i The pixel value G'2h of the horizontal green pixel 252 i =mG'1h i +Wh i , wherein the mG'1h i is the arbitrary pixel position 100a i The initial horizontal pixel value of the green pixel 242, the Wh i The horizontal white pixel interpolation image 220 at the arbitrary pixel position 100a i The pixel value of .

[0312] Please continue to refer to Fig.25 , the horizontal white pixel interpolation image 220 and the horizontal slowly varying blue pixel channel image 240c are added pixel by pixel at position 200a to obtain a horizontal blue pixel channel image 250c.

[0313] Specifically, in the horizontal blue pixel channel image 250c, any pixel position 200a i The pixel value of the horizontal blue pixel 253 is B'2h i =mB'1h i +Wh i , wherein the mB'1h i is the arbitrary pixel position 100a i The initial horizontal pixel value of the blue pixel 243, the Wh i The horizontal white pixel interpolation image 220 at the arbitrary pixel position 100a i The pixel value of .

[0314] Please continue to refer to Fig.25 , the horizontal red pixel channel image 250a, the horizontal green pixel channel image 250b and the horizontal blue pixel channel image 250c are merged to form a horizontal demosaiced color image 250.

[0315] Thus, a horizontal demosaic color image 250 including information of white pixels and information of color pixels and interpolated in the horizontal direction X is formed.

[0316] Specifically, the horizontal demosaiced color image 250 has three complete pixel channels, that is, the pixels of the horizontal demosaiced color image 250 at each pixel position 200 a include: a horizontal red pixel 251 , a horizontal green pixel 252 , and a horizontal blue pixel 253 .

[0317] In some other embodiments, the method for obtaining a horizontal demosaic color image further includes: merging the horizontal red pixel channel image 250a, the horizontal green pixel channel image 250b, the horizontal blue pixel channel image 250c and the horizontal white pixel interpolation image 220 to form the horizontal demosaic color image. Compared with the horizontal demosaic color image 250, the horizontal demosaic color image has a total of 4 complete pixel channels, that is, the pixels of the horizontal demosaic color image at each pixel position 200a include: horizontal red pixels 251, horizontal green pixels 252, horizontal blue pixels 253 and adjusted white pixels 214, or horizontal red pixels 251, horizontal green pixels 252, horizontal blue pixels 253 and horizontal interpolated white pixels 224, thus, it is beneficial to further improve the quality of the formed color image and the restored color image.

[0318] Please combine Fig. 20 and Fig.21 refer to Fig.26 According to the initial white pixels 204 on both sides of each initial color pixel along the vertical direction Y, a second interpolation process is performed on the pixel position 200a where each initial color pixel is located to obtain a vertical white pixel interpolation image 260.

[0319] In this embodiment, the method for performing the second interpolation processing on the pixel position 200a where each initial color pixel is located according to the initial white pixels 204 on both sides of each initial color pixel along the vertical direction Y includes: i (like Fig. 20 ) The pixel values ​​W3 of the two adjusted white pixels 214 corresponding to the two adjacent initial white pixels 204 are shown in FIG. i and pixel value W4 i , obtain the initial color pixel C i The vertical white pixel interpolation Wv at pixel position 200a i =(W3 i +W4 i ) / 2; with the initial color pixel C i The vertical white pixel interpolation Wv at pixel position 200a i , interpolating to the same pixel position 200a in the adjusted mosaic image 210.

[0320] Specifically, in the vertical direction Y, any initial color pixel C i The two adjusted white pixels 214 corresponding to the two adjacent initial white pixels 204 refer to: i (like Fig.21 2 adjacent adjusted white pixels 214 as shown).

[0321] Specifically, after the second interpolation process, the vertical white pixel interpolation image 260 includes: a plurality of adjusted white pixels 214 and a plurality of vertical interpolated white pixels 264. i The pixel value of the vertically interpolated white pixel 264 is Wv i =(W3 i +W4 i Furthermore, the plurality of adjusted white pixels 214 and the vertical and horizontal interpolated white pixels 264 are arranged at intervals in the horizontal direction X and the vertical direction Y.

[0322] Next, according to the vertical white pixel interpolation image 260 and the mosaic image to be processed 200, a vertical demosaiced color image 290 (eg Fig.29 shown).

[0323] Specifically, since the adjusted mosaic image 210 is obtained based on the mosaic image 200 to be processed, in this embodiment, the method for obtaining the vertical demosaiced color image 290 based on the vertical white pixel interpolation image 260 and the mosaic image 200 to be processed further includes: obtaining the vertical demosaiced color image 290 based on the vertical white pixel interpolation image 260 and the adjusted mosaic image 210.

[0324] For specific steps of obtaining the vertical demosaiced color image 290, please refer to Figure 27 to Figure 29 .

[0325] Please refer to Fig. 27 , a pixel value subtraction process is performed on the adjusted mosaic image 210 and the vertical white pixel interpolation image 260 at each pixel position 100 a to obtain a vertical slowly varying mosaic image 270 .

[0326] The vertical slowly changing mosaic image 270 includes: a plurality of vertical slowly changing red pixels 271 located at the same pixel position 200a as the plurality of adjusted red pixels 211, a plurality of vertical slowly changing green pixels 272 located at the same pixel position 200a as the plurality of adjusted red pixels 211, and a plurality of vertical slowly changing blue pixels 273 located at the same pixel position 200a as the plurality of adjusted red pixels 211.

[0327] Specifically, the pixel value R'1v=R'-Wv of any vertical slowly changing red pixel 271, wherein R' refers to the pixel value of the adjusted red pixel 211 at the same pixel position 200a as the arbitrary vertical slowly changing red pixel 271; and Wv refers to the pixel value of the vertical interpolated white pixel 264 at the same pixel position 200a as the arbitrary vertical slowly changing red pixel 271.

[0328] Similarly, the pixel value G'1v=G'-Wv of any vertical slowly changing green pixel 272, wherein G' refers to the pixel value of the adjusted green pixel 212 at the same pixel position 200a as the arbitrary vertical slowly changing green pixel 272; and Wv refers to the pixel value of the vertical interpolated white pixel 264 at the same pixel position 200a as the arbitrary vertical slowly changing green pixel 272.

[0329] Similarly, the pixel value B'1v=B'-Wv of any vertical slowly changing blue pixel 273, wherein B' refers to the pixel value of the adjusted blue pixel 213 at the same pixel position 200a as the arbitrary vertical slowly changing blue pixel 273; and Wv refers to the pixel value of the vertical interpolated white pixel 264 at the same pixel position 200a as the arbitrary vertical slowly changing blue pixel 273.

[0330] Similarly, the pixel position 100a where the white pixel 214 is located is arbitrarily adjusted, and the corresponding pixel value in the vertical slowly changing mosaic image 270 is 0 (eg Fig. 27 shown).

[0331] Please refer to Fig.28 According to the multiple vertical slowly changing red pixels 271, the vertical slowly changing mosaic image 270 is subjected to a sixth interpolation process to obtain a vertical slowly changing red pixel channel image 280a, wherein each pixel position 200a of the vertical slowly changing red pixel channel image 280a has one initial vertical red pixel 281.

[0332] The sixth interpolation processing method includes: bilinear interpolation processing, bicubic interpolation processing, mean filter interpolation processing or median filter interpolation processing.

[0333] Similar to the third interpolation process, the pixel value mR'1h of the initial horizontal red pixel 241 of each pixel position 200a is obtained to form a horizontal slowly changing red pixel channel image 240a. Through the sixth interpolation process, the pixel value mR'1v of the initial vertical red pixel 281 of each pixel position 200a is obtained to form a vertical slowly changing red pixel channel image 280a.

[0334] Please continue to refer to Fig.28According to the multiple vertical slowly varying green pixels 272 , the vertical slowly varying mosaic image 270 is subjected to a seventh interpolation process to obtain a vertical slowly varying green pixel channel image 280 b , wherein each pixel position 200 a of the vertical slowly varying green pixel channel image 280 b has one initial vertical green pixel 282 .

[0335] The seventh interpolation processing method includes: bilinear interpolation processing, bicubic interpolation processing, mean filter interpolation processing or median filter interpolation processing.

[0336] Similarly, through the seventh interpolation process, the pixel value mG′1v of the initial vertical green pixel 282 at each pixel position 200a is obtained to form a vertical slowly varying green pixel channel image 280b.

[0337] Please continue to refer to Fig.28 According to the multiple vertical slowly varying blue pixels 273 , an eighth interpolation process is performed on the vertical slowly varying mosaic image 270 to obtain a vertical slowly varying blue pixel channel image 280c , wherein each pixel position 200a of the vertical slowly varying blue pixel channel image 280c has one initial vertical blue pixel 283 .

[0338] The eighth interpolation processing method includes: bilinear interpolation processing, bicubic interpolation processing, mean filter interpolation processing or median filter interpolation processing.

[0339] Similarly, through the eighth interpolation process, the pixel value mB′1v of the initial vertical blue pixel 283 at each pixel position 200a is obtained to form a vertical slowly varying blue pixel channel image 280c.

[0340] In this embodiment, the sixth interpolation processing, the seventh interpolation processing, and the eighth interpolation processing methods are the same as the third interpolation processing, the fourth interpolation processing, and the fifth interpolation processing methods, so as to further improve the quality of the restored color image formed.

[0341] For specific working methods of the sixth interpolation processing, the seventh interpolation processing, and the eighth interpolation processing, reference may be made to the illustrative description of the working method of the third interpolation processing in this embodiment, which will not be repeated here.

[0342] In other embodiments, the methods of the third interpolation process, the fourth interpolation process, the fifth interpolation process, the sixth interpolation process, the seventh interpolation process, and the eighth interpolation process may also be different from each other.

[0343] Please refer to Fig.29 , the vertical white pixel interpolation image 260 and the vertical slowly varying red pixel channel image 280a are added pixel by pixel at position 200a to obtain a vertical red pixel channel image 290a.

[0344] Specifically, in the vertical red pixel channel image 290a, any pixel position 200a i The pixel value R'2v of the vertical red pixel 291 i =mR'1v i +Wv i , wherein the mR'1v i is the arbitrary pixel position 100a i The pixel value of the initial vertical red pixel 281, the Wv i The vertical white pixel interpolation image 260 at the arbitrary pixel position 100a i The pixel value of .

[0345] Please continue to refer to Fig.29 , the vertical white pixel interpolation image 260 and the vertical slowly varying green pixel channel image 280b are added pixel by pixel at position 200a to obtain a vertical green pixel channel image 290b.

[0346] Specifically, in the vertical green pixel channel image 290b, any pixel position 200a i The pixel value G'2v of the vertical green pixel 292 i =mG'1v i +Wv i , wherein the mG'1v i is the arbitrary pixel position 100a i The pixel value of the initial vertical green pixel 282, the Wv i The vertical white pixel interpolation image 260 at the arbitrary pixel position 100a i The pixel value of .

[0347] Please continue to refer to Fig.29 , the vertical white pixel interpolation image 260 and the vertical slowly varying blue pixel channel image 280c are added pixel by pixel at position 200a to obtain a vertical blue pixel channel image 291c.

[0348] Specifically, in the vertical blue pixel channel image 291c, any pixel position 200a i The pixel value B'2v of the vertical blue pixel 293 i =mB'1v i +Wv i , wherein the mB'1v i is the arbitrary pixel position 100a i The initial vertical blue pixel 283 pixel value, the Wv i The vertical white pixel interpolation image 260 at the arbitrary pixel position 100a iThe pixel value of .

[0349] Please continue to refer to Fig.29 , the vertical red pixel channel image 290a, the vertical green pixel channel image 290b and the vertical blue pixel channel image 290c are merged to form a vertical demosaiced color image 290.

[0350] Thus, a vertical demosaiced color image 290 including information of white pixels and information of color pixels and interpolated in the vertical direction Y is formed.

[0351] Specifically, the vertical demosaiced color image 290 has three complete pixel channels, that is, the pixels of the vertical demosaiced color image 290 at each pixel position 200 a include: a vertical red pixel 291 , a vertical green pixel 292 , and a vertical blue pixel 293 .

[0352] In some other embodiments, the vertical red pixel channel image 290a, the vertical green pixel channel image 290b, the vertical blue pixel channel image 290c and the vertical white pixel interpolation image 260 are combined to form a vertical demosaic color image. Compared with the vertical demosaic color image 290, the vertical demosaic color image has a total of 4 complete pixel channels. That is, the pixels of the vertical demosaic color image at each pixel position 200a include: a vertical red pixel 291, a vertical green pixel 292, a vertical blue pixel 293 and an adjusted white pixel 214, or a vertical red pixel 291, a vertical green pixel 292, a vertical blue pixel 293 and a vertical interpolation white pixel 264, therefore, it is beneficial to further improve the quality of the formed color image and the restored color image.

[0353] Next, according to the horizontal demosaiced color image 250 and the vertical demosaiced color image 290, the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position 200a are obtained. Fig.25 , Fig.29 and Fig.30 The method of obtaining the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position 200 a is described in detail.

[0354] Please refer to Fig.25 and Fig.29 , perform color space conversion on the horizontal demosaiced color image 250 to obtain the horizontal brightness component Lh and horizontal chrominance component of each pixel position 200a.

[0355] In this embodiment, the horizontal chrominance component of each pixel position 200a includes: a first horizontal chrominance component Ah and a second horizontal chrominance component Bh.

[0356] In this embodiment, according to the horizontal demosaiced color image 250 and the vertical demosaiced color image 290, the method for obtaining the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position 200a also includes: performing color space conversion on the vertical demosaiced color image 290 to obtain the vertical brightness component Lv and the vertical chromaticity component of each pixel position 200a.

[0357] In this embodiment, the vertical chromaticity components of each pixel position 200 a include: a first vertical chromaticity component Av and a second vertical chromaticity component Bv.

[0358] Specifically, in this embodiment, the horizontal demosaiced color image 250 and the vertical demosaiced color image 290 are converted from the RGB color space to the CIELAB color space to obtain corresponding brightness components and chrominance components.

[0359] In this embodiment, the method for obtaining the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position 200a according to the horizontal demosaiced color image 250 and the vertical demosaiced color image 290 further includes: obtaining the color difference uniformity threshold eH of each pixel position 200a according to the horizontal brightness component Lh and the horizontal chromaticity component of the pixel position 200a on both sides of each pixel position 200a along the horizontal direction X, the vertical brightness component Lv and the vertical chromaticity component of the pixel position 200a on both sides of each pixel position 200a along the vertical direction Y, and the horizontal brightness component Lh, the horizontal chromaticity component, the vertical brightness component Lv and the vertical chromaticity component of each pixel position 200a.

[0360] The following will be based on Fig.30 A method of obtaining the color difference uniformity threshold value eH at each pixel position 200a is described in detail.

[0361] Please refer to Fig.30 , according to the horizontal luminance component Lh, the first horizontal chrominance component and the second horizontal chrominance component of the arbitrary pixel position 200a[xi,yi], and the pixel position 200a[xi-1,yi] and the pixel position 200a[xi+1,yi] on both sides of the pixel position 200a[xi,yi] along the horizontal direction X, obtain the specified horizontal luminance color difference eH_h of the pixel position 200a[xi,yi] [xi,yi] .

[0362] In this embodiment, the method for obtaining the specified horizontal luminance color difference eH_h[xi,yi] of the pixel position 200a[xi,yi] includes: obtaining the horizontal luminance color difference ΔEh between the pixel position 200a[xi,yi] and the pixel position 200a[xi-1,yi] according to the horizontal luminance component Lv, the first horizontal chromaticity component Ah and the second horizontal chromaticity component Bh of the pixel position 200a[xi,yi] and the pixel position 200a[xi-1,yi] [xi,yi],[xi-1,yi] ; According to the pixel position 200a[x i ,y i ] and pixel position 200a[x i +1,y i ], the horizontal luminance component Lv, the first horizontal chrominance component Ah and the second horizontal chrominance component Bh, and the pixel position 200a[x i ,y i ] and pixel position 200a[x i +1,y i ] between the horizontal brightness color difference △Eh [xi,yi],[xi+1,yi] ; According to the horizontal brightness color difference △Eh [xi,yi],[xi-1,yi] and horizontal brightness color difference △Eh [xi,yi],[xi+1,yi] , get the pixel position [x i ,y i ] contains the specified level of brightness color difference eH_h [xi,yi] =max(ΔEh [xi,yi],[xi-1,yi] ,ΔEh [xi,yi],[xi+1,yi] ).

[0363] Specifically, [xi,yi] =max(ΔEh [xi,yi],[xi-1,yi] ,ΔEh [xi,yi],[xi+1,yi] ) means: comparison of horizontal brightness color difference △Eh [xi,yi],[xi-1,yi] and horizontal brightness color difference △Eh [xi,yi],[xi+1,yi] , the larger of the two is used as the specified horizontal luminance color difference eH_h at the pixel position 200a[xi,yi] [xi,yi] .

[0364] Specifically obtain any pixel position 200a[x i ,y i ], and another arbitrary pixel position 200a[x j ,y j ] between the horizontal brightness color difference △Eh [xi,yi],[xj,yj] For methods, please refer to Fig.11 In the embodiment shown, for obtaining any pixel position 100a[x i ,y i ], and another arbitrary pixel position 100a[xj ,y j ] between the horizontal brightness color difference △Eh [xi,yi],[xj,yj] The detailed description of the method will not be repeated here.

[0365] Please continue to refer to Fig.30 , according to the vertical luminance component Lv, the first vertical chrominance component and the second vertical chrominance component of the arbitrary pixel position 200a[xi,yi], and the pixel position 200a[xi,yi-1] and the pixel position 200a[xi,yi+1] on both sides of the pixel position 200a[xi,yi] along the vertical direction Y, obtain the specified vertical luminance color difference eH_v of the pixel position 200a[xi,yi] [xi,yi] .

[0366] In this embodiment, the pixel position 200a[x i ,y i ] specifies the vertical brightness color difference eH_v [xi,yi] The method includes: according to the pixel position 200a[x i ,y i ] and pixel position 200a[x i ,y i -1], the vertical luminance component Lv, the first vertical chrominance component Av and the second vertical chrominance component Bv, and the pixel position 200a[x i ,y i ] and pixel position 200a[x i ,y i -1] between the vertical brightness color difference △Ev [xi,yi],[xi,yi-1] ; According to the pixel position 200a[x i ,y i ] and pixel position 200a[x i ,y i +1], the vertical luminance component Lv, the first vertical chrominance component Av and the second vertical chrominance component Bv, and the pixel position 200a[x i ,y i ] and pixel position 200a[x i ,y i +1] between the vertical brightness color difference △Ev [xi,yi],[xi,yi+1] ; According to the vertical brightness color difference △Ev [xi,yi],[xi,yi-1] And vertical brightness color difference △Ev [xi,yi],[xi,yi+1] , get the pixel position 200a[x i ,y i ] specifies the vertical brightness color difference eH_v [xi,yi] =max(ΔEv [xi,yi],[xi,yi-1] ,ΔEv [xi,yi],[xi,yi+1] ).

[0367] Specifically, eH_v [xi,yi] =max(ΔEv [xi,yi],[xi,yi-1] ,ΔEv [xi,yi],[xi,yi+1] ) means: compare vertical brightness color difference △Ev [xi,yi],[xi,yi-1] And vertical brightness color difference △Ev [xi,yi],[xi,yi+1] , the larger of the two is taken as the pixel position 200a[x i ,y i ] specifies the vertical brightness color difference eH_v [xi,yi] .

[0368] Specifically obtain any pixel position 200a[x i ,y i ], and another arbitrary pixel position 200a[x j ,y j ] between the vertical brightness color difference △Ev [xi,yi],[xj,yj] For methods, please refer to Fig.11 In the embodiment shown, for obtaining any pixel position 100a[x i ,y i ], and another arbitrary pixel position 100a[x j ,y j ] between the vertical brightness color difference △Ev [xi,yi],[xj,yj] The detailed description of the method will not be repeated here.

[0369] Please continue to refer to Fig.30 , compare the specified level containing luminance color difference eH_h [xi,yi] and the specified vertical luminance color difference eH_v [xi,yi] , get the pixel position 200a[x i ,y i ] color difference uniformity threshold eH [xi,yi] =min(eH_h [xi,yi] ,eH_v [xi,yi] ).

[0370] Specifically, the color difference uniformity threshold eH [xi,yi] =min(eH_h [xi,yi] ,eH_v [xi,yi] ) means: with a specified level of brightness color difference eH_h [xi,yi] And specify the vertical brightness color difference eH_v [xi,yi] The smaller one is used as the color difference uniformity threshold eH [xi,yi] .

[0371] It should be noted that Fig.30 The pixel position 200a of the 3*3 range is schematically shown in FIG. 1 for easy understanding: any pixel position 200a[xi ,y i ], the pixel position 200a[x i ,y i ] The pixel positions 200a[x i -1,y i ] and pixel position 200a[x i +1,y i ], and the pixel position 200a[x i ,y i ] The pixel positions 200a[x i ,y i -1] and pixel position 200a[x i ,y i +1] The positional relationship between them.

[0372] Please continue to refer to Fig.25 and Fig.29 , according to the horizontal luminance component Lh and horizontal chrominance component of each pixel position 200a, the horizontal luminance components Lh and horizontal chrominance components of multiple pixel positions 200a within a preset uniformity window range centered on each pixel position 200a, and the color difference uniformity threshold eH of each pixel position 200a, the horizontal color difference uniformity parameter homo_h of each pixel position 200a is obtained.

[0373] In this embodiment, the method for obtaining the horizontal color difference uniformity parameter homo_h of each pixel position 200a further includes: obtaining N horizontal luminance color differences ΔEh between the arbitrary pixel position 200a and each pixel position 200a of the N pixel positions 200a according to the horizontal luminance component Lh and the horizontal chrominance component of the arbitrary pixel position 200a, and the horizontal luminance components Lh and the horizontal chrominance components of the N pixel positions 200a within the preset uniformity window range centered on the arbitrary pixel position 200a; comparing the N horizontal luminance color differences ΔEh with the color difference uniformity threshold value eH of the arbitrary pixel position 200a respectively to obtain the number of horizontal uniformity pixels Nh; and obtaining the horizontal color difference uniformity parameter homo_h=Nh / N of the arbitrary pixel position 200a according to the number of horizontal uniformity pixels Nh.

[0374] The number of horizontal uniformity pixels Nh is: the number of horizontal luminance color differences ΔEh that are less than or equal to the color difference uniformity threshold eH of the arbitrary pixel position 200a among the N horizontal luminance color differences ΔEh.

[0375] Since the N horizontal luminance color differences ΔEh necessarily include: the horizontal luminance color difference ΔEh between the pixel position 200a located at the center of the preset uniformity window and itself, the horizontal color difference uniformity parameter homo_h of any pixel position 200a is greater than 0.

[0376] Therefore, 0<homo_h≤1.

[0377] For a detailed method of obtaining the horizontal color difference uniformity parameter homo_h=Nh / N at any pixel position 200a, please refer to Fig.12 The example description of obtaining the horizontal color difference uniformity parameter homo_h of any pixel position 100a is provided for easy understanding and will not be repeated here.

[0378] Please continue to refer to Fig.25 and Fig.29 , obtain the vertical color difference uniformity parameter homo_v of each pixel position 200a according to the vertical luminance component Lv and the vertical chrominance component of each pixel position 200a, the vertical luminance component Lv and the vertical chrominance component of multiple pixel positions 200a within a preset uniformity window range centered on each pixel position 200a, and the color difference uniformity threshold eH of each pixel position 200a.

[0379] In this embodiment, the method for obtaining the vertical color difference uniformity parameter of each pixel position 200a further includes: obtaining N vertical luminance color differences ΔEv between the arbitrary pixel position 200a and each pixel position 200a of the N pixel positions 200a according to the vertical luminance component Lv and the vertical chromaticity component of the arbitrary pixel position 200a, and the vertical luminance components Lv and the vertical chromaticity components of the N pixel positions 200a within the preset uniformity window range centered on the arbitrary pixel position 200a; comparing the N vertical luminance color differences ΔEv with the color difference uniformity threshold value eH of the arbitrary pixel position 200a respectively to obtain the vertical uniformity pixel number Nv; and obtaining the vertical color difference uniformity parameter homo_v=Nv / N of the arbitrary pixel position 200a according to the vertical uniformity pixel number Nv.

[0380] The vertical uniformity pixel number Nv is: the number of vertical luminance color difference ΔEv that is less than or equal to the color difference uniformity threshold value eH of the arbitrary pixel position 200a among the N vertical luminance color difference ΔEv.

[0381] For a specific method of obtaining the vertical color difference uniformity parameter homo_v=Nv / N at any pixel position 200a, please refer to Fig.12In the example of FIG. 1 , the method for obtaining the horizontal color difference uniformity parameter homo_h of any pixel position 100 a is illustrated for easy understanding and will not be repeated here.

[0382] Similarly, since the N vertical luminance color differences ΔEv necessarily include: the vertical luminance color difference ΔEv between the pixel position 100a located at the center of the preset uniformity window and itself, the vertical color difference uniformity parameter homo_v of any pixel position 100a is greater than 0.

[0383] Therefore, 0<homo_v≤1.

[0384] The horizontal color difference uniformity parameter homo_h at each pixel position 200 a is used to measure the neatness and uniformity of the interpolation result in the horizontal direction X. That is, the neatness and uniformity between the pixel at the pixel position 200 a and the surrounding pixels of the horizontal demosaiced color image 250 .

[0385] Since the pixel position 200a[x i ,y i ] contains the specified level of brightness color difference eH_h [xi,yi] And specify the vertical brightness color difference eH_v [xi,yi] The smaller one is taken as the color difference uniformity threshold eH [xi,yi] Therefore, the N levels of brightness color difference △Eh are respectively compared with the color difference uniformity threshold eH [xi,yi] When making comparisons, it is possible to ensure that △Eh≤eH [xi,yi] The pixel at the pixel position of is the pixel with smaller color difference. Thus, the accuracy of the horizontal color difference uniformity parameter homo_h when measuring the neatness and uniformity of the interpolation result in the horizontal direction X is better ensured.

[0386] In addition, due to the horizontal brightness color difference △Eh [xi,yi],[xi-1,yi] and horizontal brightness color difference △Eh [xi,yi],[xi+1,yi] The larger one is used as the pixel position 200a[x i ,y i ] contains the specified level of brightness color difference eH_h [xi,yi] , therefore, the color difference uniformity threshold eH_h can be reduced [xi,yi] Too small: within the preset uniformity window, the pixel position 200a[x i ,y i ], there are no or very few pixels at the pixel position 200a that can satisfy △Eh≤eH [xi,yi] Thus, the accuracy of the horizontal color difference uniformity parameter homo_h in measuring the neatness and uniformity of the interpolation result in the horizontal direction X is further ensured.

[0387] The vertical color difference uniformity parameter homo_v of each pixel position 200 a is used to measure the neatness and uniformity of the interpolation result in the vertical direction Y. That is, the neatness and uniformity between the pixel at the pixel position 200 a and the surrounding pixels of the vertical demosaiced color image 290 .

[0388] Since the pixel position 200a[x i ,y i ] contains the specified level of brightness color difference eH_h [xi,yi] And specify the vertical brightness color difference eH_v [xi,yi] The smaller one is taken as the color difference uniformity threshold eH [xi,yi] Therefore, the N vertical luminance color difference △Ev are respectively compared with the color difference uniformity threshold eH [xi,yi] When making comparisons, it is possible to ensure that △Ev≤eH [xi,yi] The pixel at the pixel position of is a pixel with smaller color difference. Thus, the accuracy of the vertical color difference uniformity parameter homo_v when measuring the neatness and uniformity of the interpolation result in the vertical direction Y is better ensured.

[0389] In addition, due to the vertical brightness color difference △Ev [xi,yi],[xi,yi-1] And vertical brightness color difference △Ev [xi,yi],[xi,yi+1] The larger one is taken as the pixel position 200a[x i ,y i ] specifies the vertical brightness color difference eH_v [xi,yi] , therefore, the color difference uniformity threshold eH can be reduced [xi,yi] Too small: within the preset uniformity window, the pixel position 200a[x i ,y i ], there are no or very few pixels at the pixel position 200a that can satisfy △Ev≤eH [xi,yi] Thus, the accuracy of the vertical color difference uniformity parameter homo_v in measuring the neatness and uniformity of the interpolation result in the vertical direction Y is further ensured.

[0390] Please refer to Fig.31 According to the size relationship between the horizontal color difference uniformity parameter homo_h and the vertical color difference uniformity parameter homo_v of each pixel position 200a, in the horizontal demosaiced color image 250 or the vertical demosaiced color image 290, the pixel of each pixel position 200a is obtained to form a color image 300.

[0391] In this embodiment, the first interpolation process and the second interpolation process are performed according to the initial white pixels 204 on both sides of each initial color pixel along the horizontal direction X and the initial white pixels 204 on both sides of each initial color pixel along the vertical direction Y, respectively, to obtain a horizontal white pixel interpolation image 220 and a vertical white pixel interpolation image 260, and a horizontal demosaiced color image 250 and a vertical demosaiced color image 290 are formed according to the horizontal white pixel interpolation image 220, the vertical white pixel interpolation image 260, and the mosaic image 200 to be processed. Therefore, the horizontal demosaiced color image 250 and the vertical demosaiced color image 290 both contain information of white pixels and information of color pixels.

[0392] On this basis, since the horizontal color difference uniformity parameter homo_h and the vertical color difference uniformity parameter homo_v of each pixel position 200a are obtained according to the horizontal demosaiced color image 250 and the vertical demosaiced color image 290, and according to the size relationship between the horizontal color difference uniformity parameter homo_h and the vertical color difference uniformity parameter homo_v of each pixel position 200a, the pixel of each pixel position 200a is obtained in the horizontal demosaiced color image 250 or the vertical demosaiced color image 290 to form the color image 300, therefore, the information of the white pixel and the color pixel is used at the same time, and the color difference uniformity in the horizontal direction X and the vertical direction Y corresponding to each pixel position 200a is compared, so that when the white pixel interpolation direction with better color difference uniformity is judged for each pixel position 200a, the judgment accuracy of the interpolation direction can be improved. Thus, a more accurate interpolated pixel at each pixel position 200a can be selected in the horizontal demosaiced color image 250 or the vertical demosaiced color image 290, thereby reducing the pseudo color in the color image 300 and improving the quality of the demosaiced color image 300. Accordingly, since the restored color image is formed based on the color image 300, the pseudo color of the color image can also be restored, thereby improving the quality of the restored color image.

[0393] Specifically, since the horizontal color difference uniformity parameter homo_h of each pixel position 200a is used to measure the neatness and uniformity of the interpolation result in the horizontal direction X, and the vertical color difference uniformity parameter homo_v of each pixel position 200a is used to measure the neatness and uniformity of the interpolation result in the vertical direction Y, therefore, according to the size relationship between the horizontal color difference uniformity parameter homo_h and the vertical color difference uniformity parameter homo_v of each pixel position 200a, it is possible to determine the one with better color difference uniformity among the pixels at the same pixel position 200a of the horizontal demosaiced color image 250 and the vertical demosaiced color image 290, thereby, a more accurate interpolated pixel can be selected at each pixel position 200a.

[0394] In addition, since the initial white pixel 204 in the mosaic image 200 to be processed is obtained by capturing photons through the transparent filter in the color image sensor, the overall pixel value of the initial white pixel 204 in the mosaic image 200 to be processed is higher (more photons are captured) than the initial color pixel.

[0395] In this embodiment, since the pixel value uniformity processing is performed on the mosaic image 200 to be processed to obtain the adjusted mosaic image 210 before obtaining the horizontal white pixel interpolation image 220 and the vertical white pixel interpolation image 260, the overall ratio of the pixel values ​​of the initial color pixels and the initial white pixels 204 in the mosaic image 200 to be processed is adjusted, so that the pixel values ​​of the multiple adjusted white pixels 214, the multiple adjusted red pixels 211, the multiple adjusted green pixels 212, and the multiple adjusted blue pixels 213 of the formed adjusted mosaic image 210 are correlated and the overall ratio is more balanced.

[0396] On this basis, since the pixel values ​​of the adjusted mosaic image 210 and the horizontal white pixel interpolation image 220 are subtracted at the pixel position 200a one by one to obtain the horizontal slowly varying mosaic image 240, the pixel values ​​of the obtained horizontal slowly varying mosaic image 240 in the horizontal direction X and the vertical direction Y can have the characteristic of slow spatial variation, so that the horizontal slowly varying mosaic image 240 can be subjected to more accurate interpolation processing (third interpolation processing, fourth interpolation processing, fifth interpolation processing), so that the obtained horizontal slowly varying red pixel channel image 240a, horizontal slowly varying green pixel channel image 240b and horizontal slowly varying blue pixel channel image 240c have higher interpolation accuracy, and accordingly, the horizontal de-mosaiced color image 250 obtained based on the horizontal slowly varying red pixel channel image 240a, horizontal slowly varying green pixel channel image 240b and horizontal slowly varying blue pixel channel image 240c also has higher interpolation accuracy.

[0397] Similarly, since the pixel values ​​of the adjusted mosaic image 210 and the vertical white pixel interpolation image 250 are subtracted at the pixel position 200a one by one to obtain the vertical slowly varying mosaic image 280, the pixel values ​​of the obtained vertical slowly varying mosaic image 280 in the horizontal direction X and the vertical direction Y can have the characteristic of slow spatial variation, so that the vertical slowly varying mosaic image can be subjected to more accurate interpolation processing (sixth interpolation processing, seventh interpolation processing, eighth interpolation processing), so that the obtained vertical slowly varying red pixel channel image 280a, vertical slowly varying green pixel channel image 280b and vertical slowly varying blue pixel channel image 280c have higher interpolation accuracy, and accordingly, the vertical de-mosaiced color image 290 obtained based on the vertical slowly varying red pixel channel image 280a, vertical slowly varying green pixel channel image 280b and vertical slowly varying blue pixel channel image 280c also has higher interpolation accuracy.

[0398] Thus, the interpolation accuracy is further improved, and the pseudo colors in the color image 300 are better reduced, so as to improve the quality of the color image 300 after demosaicing.

[0399] In this embodiment, according to the size relationship between the horizontal color difference uniformity parameter homo_h and the vertical color difference uniformity parameter homo_v of each pixel position 200a, in the horizontal demosaiced color image 250 or the vertical demosaiced color image 290, the pixel of each pixel position 200a is obtained to form the color image 300, including: when the horizontal color difference uniformity parameter homo_h of any pixel position 200a is greater than or equal to the vertical color difference uniformity parameter homo_v, according to the pixel of the horizontal demosaiced color image 250 at the arbitrary pixel position 200a, the pixel of the arbitrary pixel position 200a is obtained; when the horizontal color difference uniformity parameter homo_h of any pixel position 200a is less than the vertical color difference uniformity parameter homo_v, according to the pixel of the vertical demosaiced color image 290 at the arbitrary pixel position 200a, the pixel of the arbitrary pixel position 200a is obtained.

[0400] Therefore, based on the horizontal color difference uniformity parameter homo_h and the vertical color difference uniformity parameter homo_v in this embodiment, the judgment and acquisition of the one with better color difference uniformity among the pixels at the same pixel position 200a of the horizontal demosaiced color image 250 and the vertical demosaiced color image 290 is achieved to form a color image 300 with less pseudo color.

[0401] It should be understood that in this embodiment, since the horizontal red pixel channel image 250a, the horizontal green pixel channel image 250b and the horizontal blue pixel channel image 250c are merged to form a horizontal demosaiced color image 250, and the vertical red pixel channel image 290a, the vertical green pixel channel image 290b and the vertical blue pixel channel image 290c are merged to form a vertical demosaiced color image 290, the pixels of the color image 300 at each pixel position 200a include: red pixels, green pixels and blue pixels.

[0402] Similarly, in some other embodiments, since the horizontal red pixel channel image 250a, the horizontal green pixel channel image 250b, the horizontal blue pixel channel image 250c and the horizontal white pixel interpolation image 220 are merged to form a horizontal demosaiced color image, and the vertical red pixel channel image 290a, the vertical green pixel channel image 290b, the vertical blue pixel channel image 290c and the vertical white pixel interpolation image 260 are merged to form a vertical demosaiced color image, the pixels of the color image at each pixel position include: red pixels, green pixels, blue pixels and white pixels.

[0403] Please refer to Fig.32 , the color image 300 is restored to form a restored color image 310.

[0404] In this embodiment, the restoration processing includes: adjusting each red pixel (not shown) of the color image 300 according to the first adjustment coefficient coefR to form a corresponding restored red pixel (not shown); adjusting each green pixel (not shown) of the color image 300 according to the second adjustment coefficient coefG to form a corresponding restored green pixel (not shown); adjusting each blue pixel (not shown) of the color image 300 according to the third adjustment coefficient coefB to form a corresponding restored blue pixel (not shown).

[0405] Therefore, compared with the mosaic image 200 to be processed, the color pixel channels (the channel of red pixels, the channel of green pixels and the channel of blue pixels) in the color image 300 have their pixel value ratios adjusted and proportionally restored, thereby forming a restored color image 310 that is closer to the real color and has a more coordinated overall color, so as to further improve the image quality for viewing.

[0406] In this embodiment, the method of adjusting each red pixel of the color image 300 according to the first adjustment coefficient coefR to form a corresponding restored red pixel includes: dividing each red pixel of the adjusted color image 300 by the first adjustment coefficient coefR to form a corresponding restored red pixel.

[0407] Similarly, the method of adjusting each green pixel of the color image 300 according to the second adjustment coefficient coefG to form a corresponding restored green pixel includes: dividing each green pixel of the adjusted color image 300 by the second adjustment coefficient coefG to form a corresponding restored green pixel.

[0408] Similarly, the method of adjusting each blue pixel of the color image 300 according to the third adjustment coefficient coefB to form a corresponding restored blue pixel includes: dividing each blue pixel of the adjusted color image 300 by the third adjustment coefficient coefB to form a corresponding restored blue pixel.

[0409] In some other embodiments, when the color image also includes a channel of white pixels, the restoration processing method further includes: adjusting each white pixel of the color image according to a fourth adjustment coefficient coefW to form a corresponding restored white pixel.

[0410] Similarly, a method for adjusting each white pixel of a color image according to a fourth adjustment coefficient coefW to form a corresponding restored white pixel includes: dividing each white pixel of the adjusted color image by the fourth adjustment coefficient coefW to form a corresponding restored white pixel.

[0411] In this embodiment, the color image processing method further includes: outputting the restored color image 310 .

[0412] In other embodiments, the color image processing method further includes: outputting the color image 300 .

[0413] Fig.33 A color image processing device according to another embodiment of the present invention.

[0414] Accordingly, another embodiment of the present invention further provides a method for implementing Figures 19 to 32 The color image processing method and the color image processing device in the embodiment described above are combined with Figures 19 to 32 refer to Fig.33 The color image processing device 600 includes: a color image sensor 610, used to obtain a mosaic image 200 to be processed, wherein the mosaic image 200 to be processed includes a plurality of initial white pixels 204 and a plurality of initial color pixels arranged in a two-dimensional array at a plurality of pixel positions 200a; and a de-mosaicing unit 620, used to perform de-mosaicing on the mosaic image 200 to be processed to obtain a color image 300.

[0415] The following is a detailed description with reference to the accompanying drawings.

[0416] Please continue to refer to Fig.33The de-mosaicing unit 620 includes: a pixel value uniformity adjustment unit 621, which performs pixel value uniformity processing on the mosaic image 200 to be processed to obtain an adjusted mosaic image 210.

[0417] The adjusted mosaic image 210 includes a plurality of adjusted white pixels 214 and a plurality of adjusted color pixels arranged in a two-dimensional array at a plurality of pixel positions 200 a.

[0418] The plurality of adjusted color pixels include: a plurality of adjusted red pixels 211 , a plurality of adjusted green pixels 212 , and a plurality of adjusted blue pixels 213 .

[0419] The average pixel value meanR′ of the plurality of adjusted red pixels 211 , the average pixel value meanG′ of the plurality of adjusted green pixels 212 , the average pixel value meanB′ of the plurality of adjusted blue pixels 213 , and the average pixel value meanW′ of the plurality of adjusted white pixels 214 are equal.

[0420] In this embodiment, the pixel value uniformity adjustment unit 621 includes: an average pixel value acquisition module (not shown), which is used to obtain the average pixel value meanR of multiple initial red pixels 201, the average pixel value meanG of multiple initial green pixels 202, the average pixel value meanB of multiple initial blue pixels 203, and the average pixel value meanW of multiple initial white pixels 204.

[0421] In this embodiment, the pixel value uniformity adjustment unit 621 also includes: an adjustment coefficient acquisition module (not shown), which is used to obtain the first adjustment coefficient coefR, the second adjustment coefficient coefG, the third adjustment coefficient coefB and the fourth adjustment coefficient coefW according to the average pixel value meanR, the average pixel value meanG, the average pixel value meanB and the average pixel value meanW.

[0422] In this embodiment, the pixel value uniformity adjustment unit 621 also includes: a uniformity adjustment module (not shown), which is used to adjust the pixel value R of each initial red pixel 201 according to the first adjustment coefficient coefR to form a corresponding adjusted red pixel 211, and adjust the pixel value G of each initial green pixel 202 according to the second adjustment coefficient coefG to form a corresponding adjusted green pixel 212, and adjust the pixel value B of each initial blue pixel 203 according to the third adjustment coefficient coefB to form a corresponding adjusted blue pixel 213, and adjust the pixel value W of each initial white pixel 204 according to the fourth adjustment coefficient coefW to form a corresponding adjusted white pixel 214, so that the average pixel value meanR' of multiple adjusted red pixels 211, the average pixel value meanG' of multiple adjusted green pixels 212, the average pixel value meanB' of multiple adjusted blue pixels 213, and the average pixel value meanW' of multiple adjusted white pixels 214 are equal.

[0423] Please continue to refer to Fig.33 The de-mosaic processing unit 620 also includes: a first interpolation processing module 622, which is used to perform a first interpolation processing on the pixel position 200a where each initial color pixel is located according to the initial white pixels 204 on both sides of each initial color pixel along the horizontal direction X, and obtain a horizontal white pixel interpolation image 220.

[0424] In this embodiment, the first interpolation process includes: according to the horizontal direction X, i The pixel values ​​W1 of the two adjusted white pixels 214 corresponding to the two adjacent initial white pixels 204 are i and pixel value W2 i , obtain the initial color pixel C i The horizontal white pixel interpolation Wh at pixel position 200a i =(W1 i +W2 i ) / 2; with the initial color pixel C i The horizontal white pixel interpolation Wh at pixel position 200a i , interpolating to the same pixel position 200a in the adjusted mosaic image 210.

[0425] Please continue to refer to Fig.33 The demosaic processing unit 620 also includes: a horizontal demosaic color image acquisition unit 623, which is used to acquire a horizontal demosaic color image 250 according to the horizontal white pixel interpolation image 220 and the mosaic image 200 to be processed.

[0426] Specifically, the horizontal demosaiced color image acquisition unit 623 in this embodiment is further used to acquire the horizontal demosaiced color image 250 according to the horizontal white pixel interpolation image 220 and the adjusted mosaic image 210 .

[0427] Please refer to Fig.34 , Fig.341 is a structural schematic diagram of a horizontal demosaic color image acquisition unit according to another embodiment of the present invention, wherein the horizontal demosaic color image acquisition unit 623 comprises: a horizontal slowly changing mosaic image acquisition module 6231, which is used to perform pixel value subtraction processing at pixel position 200a on the adjusted mosaic image 210 and the horizontal white pixel interpolation image 220 to acquire a horizontal slowly changing mosaic image 230, wherein the horizontal slowly changing mosaic image 230 comprises a plurality of horizontal slowly changing red pixels 231 located at the same pixel position 200a as the plurality of adjusted red pixels 211, a plurality of horizontal slowly changing green pixels 232 located at the same pixel position 200a as the plurality of adjusted green pixels 212, and a plurality of horizontal slowly changing blue pixels 213 located at the same pixel position 200a as the plurality of adjusted blue pixels 214. a plurality of horizontal slowly changing blue pixels 233 at positions 200a; a horizontal slowly changing red pixel channel image acquisition module 6232, for performing a third interpolation process on the horizontal slowly changing mosaic image 230 according to the plurality of horizontal slowly changing red pixels 231, to obtain a horizontal slowly changing red pixel channel image 240a, wherein each pixel position 200a of the horizontal slowly changing red pixel channel image 240a has one initial horizontal red pixel 241; a horizontal red pixel channel image acquisition module 6233, for performing a pixel-by-pixel addition process on the horizontal white pixel interpolation image 220 and the horizontal slowly changing red pixel channel image 240a, to obtain a horizontal red pixel channel image 250a; a horizontal slowly changing green pixel channel image The image acquisition module 6234 is used to perform a fourth interpolation process on the horizontal slowly varying mosaic image 230 according to the plurality of horizontal slowly varying green pixels 232 to obtain a horizontal slowly varying green pixel channel image 240b, wherein each pixel position 200a of the horizontal slowly varying green pixel channel image 240b has one initial horizontal green pixel 242; the horizontal green pixel channel image acquisition module 6235 is used to perform a pixel position 200a addition process on the horizontal white pixel interpolation image 220 and the horizontal slowly varying green pixel channel image 240b to obtain a horizontal green pixel channel image 250b; the horizontal slowly varying blue pixel channel image acquisition module 6236 is used to perform a pixel position 200a addition process on the horizontal white pixel interpolation image 220 and the horizontal slowly varying green pixel channel image 240b to obtain a horizontal green pixel channel image 250b; The smoothly changing mosaic image 230 is subjected to the fifth interpolation processing to obtain a horizontal slowly changing blue pixel channel image 240c, wherein each pixel position 200a of the horizontal slowly changing blue pixel channel image 240c has one initial horizontal blue pixel 243; a horizontal blue pixel channel image acquisition module 6237 is used to perform pixel position 200a addition processing on the horizontal white pixel interpolation image 220 and the horizontal slowly changing blue pixel channel image 240c to obtain a horizontal blue pixel channel image 250c; a horizontal merging module 6238 is used to merge the horizontal red pixel channel image 250a, the horizontal green pixel channel image 250b and the horizontal blue pixel channel image 250c to form a horizontal demosaiced color image 250.

[0428] In some other embodiments, the horizontal merging module is used to merge the horizontal red pixel channel image 250a, the horizontal green pixel channel image 250b, the horizontal blue pixel channel image 250c and the horizontal white pixel interpolation image 220 to form the horizontal demosaiced color image.

[0429] Please continue to refer to Fig.33 The de-mosaic processing unit 620 also includes: a second interpolation processing module 624, which is used to perform a second interpolation processing on the pixel position 200a where each initial color pixel is located according to the initial white pixels 204 on both sides of each initial color pixel along the vertical direction Y to obtain a vertical white pixel interpolation image 260.

[0430] In this embodiment, the second interpolation process includes: according to the vertical direction Y, i The pixel values ​​W3 of the two adjusted white pixels 214 corresponding to the two adjacent initial white pixels 204 are i and pixel value W4 i , obtain the initial color pixel C i The vertical white pixel interpolation Wv at pixel position 200a i =(W3 i +W4 i ) / 2; with the initial color pixel C i The vertical white pixel interpolation Wv at pixel position 200a i , interpolating to the same pixel position 200a in the adjusted mosaic image 210.

[0431] Please continue to refer to Fig.33 The demosaic processing unit 620 further includes: a vertical demosaic color image acquisition unit 625, which is used to acquire a vertical demosaic color image 290 according to the vertical white pixel interpolation image 260 and the mosaic image 200 to be processed.

[0432] Please refer to Fig.35 , Fig.351 is a structural schematic diagram of a vertical de-mosaic color image acquisition unit according to another embodiment of the present invention, wherein the vertical de-mosaic color image acquisition unit 625 comprises: a vertical slowly changing mosaic image acquisition module 6251, which is used to perform pixel value subtraction processing on the adjusted mosaic image 210 and the vertical white pixel interpolation image 260 at each pixel position 100a to acquire a vertical slowly changing mosaic image 270, wherein the vertical slowly changing mosaic image 270 comprises a plurality of vertical slowly changing red pixels 271 located at the same pixel position 200a as the plurality of adjusted red pixels 211, a plurality of vertical slowly changing green pixels 272 located at the same pixel position 200a as the plurality of adjusted red pixels 211, and a plurality of vertical slowly changing green pixels 273 located at the same pixel position 200a as the plurality of adjusted red pixels 211. a plurality of vertical slowly changing blue pixels 273 at positions 200a; a vertical slowly changing red pixel channel image acquisition module 6252, for performing a sixth interpolation process on the vertical slowly changing mosaic image 270 according to the plurality of vertical slowly changing red pixels 271, to obtain a vertical slowly changing red pixel channel image 280a, wherein each pixel position 200a of the vertical slowly changing red pixel channel image 280a has one initial vertical red pixel 281; a vertical red pixel channel image acquisition module 6253, for performing a pixel-by-pixel addition process on the vertical white pixel interpolation image 260 and the vertical slowly changing red pixel channel image 280a, to obtain a vertical red pixel channel image 290a; a vertical slowly changing green pixel channel image The vertical slowly varying mosaic image 270 is interpolated by the plurality of vertical slowly varying green pixels 272 to obtain a vertical slowly varying green pixel channel image 280b, wherein each pixel position 200a of the vertical slowly varying green pixel channel image 280b has one initial vertical green pixel 282; the vertical green pixel channel image acquisition module 6255 is used to perform a pixel position 200a addition process on the vertical white pixel interpolation image 260 and the vertical slowly varying green pixel channel image 280b to obtain a vertical green pixel channel image 290b; the vertical slowly varying blue pixel channel image acquisition module 6256 is used to perform a pixel position 200a addition process on the vertical white pixel interpolation image 260 and the vertical slowly varying green pixel channel image 280b to obtain a vertical green pixel channel image 290b; and the vertical slowly varying blue pixel channel image acquisition module 6257 is used to perform a pixel position 200a addition process on the vertical white pixel interpolation image 260 and the vertical slowly varying green pixel channel image 280b to obtain a vertical green pixel channel image 290b. The vertical slowly varying mosaic image 270 is subjected to the eighth interpolation processing to obtain a vertical slowly varying blue pixel channel image 280c, wherein each pixel position 200a of the vertical slowly varying blue pixel channel image 280c has one initial vertical blue pixel 283; a vertical blue pixel channel image acquisition module 6257 is used to perform pixel position 200a addition processing on the vertical white pixel interpolation image 260 and the vertical slowly varying blue pixel channel image 280c to obtain a vertical blue pixel channel image 291c; a vertical merging module 6258 is used to merge the vertical red pixel channel image 290a, the vertical green pixel channel image 290b and the vertical blue pixel channel image 290c to form a vertical demosaiced color image 290.

[0433] In some other embodiments, the vertical merging module is used to merge the vertical red pixel channel image 290a, the vertical green pixel channel image 290b, the vertical blue pixel channel image 290c and the vertical white pixel interpolation image 260 to form a vertical demosaiced color image.

[0434] Please continue to refer to Fig.33 The demosaic processing unit 620 further includes: a color difference uniformity parameter acquisition unit 626, which is used to acquire the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position 200a according to the horizontal demosaic color image 250 and the vertical demosaic color image 290.

[0435] Please refer to Fig.36 , Fig.36 It is a structural schematic diagram of a color difference uniformity parameter acquisition unit according to another embodiment of the present invention. The color difference uniformity parameter acquisition unit 626 includes: a color space conversion module 6261, which is used to perform color space conversion on the horizontal demosaiced color image 250 to obtain the horizontal brightness component Lh and the horizontal chrominance component of each pixel position 200a, and to perform color space conversion on the vertical demosaiced color image 290 to obtain the vertical brightness component Lv and the vertical chrominance component of each pixel position 200a.

[0436] In this embodiment, the horizontal chrominance component of each pixel position 200a includes: a first horizontal chrominance component Ah and a second horizontal chrominance component Bh.

[0437] In this embodiment, the vertical chromaticity components of each pixel position 200 a include: a first vertical chromaticity component Av and a second vertical chromaticity component Bv.

[0438] Please continue to refer to Fig.36 The color difference uniformity parameter acquisition unit 626 also includes: a color difference uniformity threshold acquisition unit 6262, which is used to acquire the color difference uniformity threshold eH of each pixel position 200a according to the horizontal brightness component Lh and the horizontal chromaticity component of the pixel position 200a on both sides of each pixel position 200a along the horizontal direction X, the vertical brightness component Lv and the vertical chromaticity component of the pixel position 200a on both sides of each pixel position 200a along the vertical direction Y, and the horizontal brightness component Lh, horizontal chromaticity component, vertical brightness component Lv and vertical chromaticity component of each pixel position 200a.

[0439] Please continue to refer to Fig.37 , Fig.376 is a schematic diagram of the structure of a color difference uniformity threshold acquisition unit according to another embodiment of the present invention, wherein the color difference uniformity threshold acquisition unit 6262 comprises: a designated horizontal luminance color difference acquisition unit 6262a, configured to acquire a designated horizontal luminance color difference eH_h of the pixel position 200a[xi,yi] according to the horizontal luminance component Lh, the first horizontal chrominance component and the second horizontal chrominance component of the pixel position 200a[xi,yi] and the pixel position 200a[xi-1,yi] and the pixel position 200a[xi+1,yi] on both sides of the pixel position 200a[xi,yi] along the horizontal direction X. [xi,yi] .

[0440] In this embodiment, the designated horizontal luminance color difference acquisition unit 6262a includes: a first horizontal luminance color difference acquisition module (not shown) for acquiring the horizontal luminance color difference ΔEh between the pixel position 200a[xi,yi] and the pixel position 200a[xi-1,yi] according to the horizontal luminance component Lv, the first horizontal chromaticity component Ah and the second horizontal chromaticity component Bh of the pixel position 200a[xi,yi] and the pixel position 200a[xi-1,yi]. [xi,yi],[xi-1,yi] The second level contains a brightness and color difference acquisition module (not shown), which is used to obtain the color difference according to the pixel position 200a[x i ,y i ] and pixel position 200a[x i +1,y i ], the horizontal luminance component Lv, the first horizontal chrominance component Ah and the second horizontal chrominance component Bh, and the pixel position 200a[x i ,y i ] and pixel position 200a[x i +1,y i ] between the horizontal brightness color difference △Eh [xi,yi],[xi+1,yi] ; Specify the horizontal brightness color difference acquisition module (not shown), which is used to obtain the horizontal brightness color difference △Eh [xi,yi],[xi-1,yi] and horizontal brightness color difference △Eh [xi,yi],[xi+1,yi] , get the pixel position [x i ,y i ] contains the specified level of brightness color difference eH_h [xi,yi] =max(ΔEh [xi,yi],[xi-1,yi] ,ΔEh [xi,yi],[xi+1,yi] ).

[0441] Please continue to refer to Fig.37The color difference uniformity threshold acquisition unit 6262 also includes: a specified vertical luminance color difference acquisition unit 6262b, which is used to acquire the specified vertical luminance color difference eH_v of the pixel position 200a[xi,yi] according to the vertical luminance component Lv, the first vertical chromaticity component and the second vertical chromaticity component of the pixel position 200a[xi,yi] on both sides of the pixel position 200a[xi,yi] along the vertical direction Y, the pixel position 200a[xi,yi-1] and the pixel position 200a[xi,yi+1] [xi,yi] .

[0442] In this embodiment, the designated vertical luminance color difference acquisition unit 6262b includes: a first vertical luminance color difference acquisition module (not shown), according to the pixel position 200a[x i ,y i ] and pixel position 200a[x i ,y i -1], the vertical luminance component Lv, the first vertical chrominance component Av and the second vertical chrominance component Bv, and the pixel position 200a[x i ,y i ] and pixel position 200a[x i ,y i -1] between the vertical brightness color difference △Ev [xi,yi],[xi,yi-1] The second vertical brightness color difference acquisition module (not shown) is based on the pixel position 200a[x i ,y i ] and pixel position 200a[x i ,y i +1], the vertical luminance component Lv, the first vertical chrominance component Av and the second vertical chrominance component Bv, and the pixel position 200a[x i ,y i ] and pixel position 200a[x i ,y i +1] between the vertical brightness color difference △Ev [xi,yi],[xi,yi+1] ; Specify the vertical brightness color difference acquisition module (not shown), according to the vertical brightness color difference △Ev [xi,yi],[xi,yi-1] And vertical brightness color difference △Ev [xi,yi],[xi,yi+1] , get the pixel position 200a[x i ,y i ] specifies the vertical brightness color difference eH_v [xi,yi] =max(ΔEv [xi,yi],[xi,yi-1] ,ΔEv [xi,yi],[xi,yi+1] ).

[0443] Please continue to refer to Fig.37The color difference uniformity threshold acquisition unit 6262 further includes: a color difference uniformity threshold acquisition module 6262c, which is used to compare the specified level of brightness color difference eH_h [xi,yi] and the specified vertical luminance color difference eH_v [xi,yi] , get the pixel position 200a[x i ,y i ] color difference uniformity threshold eH [xi,yi] =min(eH_h [xi,yi] ,eH_v [xi,yi] ).

[0444] Please continue to refer to Fig.36 The color difference uniformity parameter acquisition unit 626 also includes: a horizontal color difference uniformity parameter acquisition module 6263, which is used to acquire the horizontal color difference uniformity parameter homo_h of each pixel position 200a according to the horizontal brightness component Lh and horizontal chromaticity component of each pixel position 200a, the horizontal brightness components Lh and horizontal chromaticity components of multiple pixel positions 200a within a preset uniformity window range centered on each pixel position 200a, and the color difference uniformity threshold eH of each pixel position 200a.

[0445] Specifically, the horizontal color difference uniformity parameter acquisition module 6263 in this embodiment is used to: acquire N horizontal luminance color differences ΔEh between the arbitrary pixel position 200a and each pixel position 200a in the N pixel positions 200a according to the horizontal luminance component Lh and the horizontal chrominance component of the arbitrary pixel position 200a, and the horizontal luminance components Lh and the horizontal chrominance components of the N pixel positions 200a within the preset uniformity window range centered on the arbitrary pixel position 200a; compare the N horizontal luminance color differences ΔEh with the color difference uniformity threshold value eH of the arbitrary pixel position 200a respectively to acquire the number of horizontal uniformity pixels Nh; and acquire the horizontal color difference uniformity parameter homo_h=Nh / N of the arbitrary pixel position 200a according to the number of horizontal uniformity pixels Nh.

[0446] Please continue to refer to Fig.36 The color difference uniformity parameter acquisition unit 626 also includes: a vertical color difference uniformity parameter acquisition module 6264, which is used to acquire the vertical color difference uniformity parameter homo_v of each pixel position 200a according to the vertical brightness component Lv and the vertical chromaticity component of each pixel position 200a, the vertical brightness component Lv and the vertical chromaticity component of multiple pixel positions 200a within a preset uniformity window range centered on each pixel position 200a, and the color difference uniformity threshold eH of each pixel position 200a.

[0447] Specifically, the vertical color difference uniformity parameter acquisition module 6264 in this embodiment is used to: acquire N vertical luminance color differences ΔEv between the arbitrary pixel position 200a and each pixel position 200a of the N pixel positions 200a according to the vertical luminance component Lv and the vertical chrominance component of the arbitrary pixel position 200a, and the vertical luminance components Lv and the vertical chrominance components of the N pixel positions 200a within the preset uniformity window range centered on the arbitrary pixel position 200a; compare the N vertical luminance color differences ΔEv with the color difference uniformity threshold eH of the arbitrary pixel position 200a respectively to acquire the vertical uniformity pixel number Nv; and acquire the vertical color difference uniformity parameter homo_v=Nv / N of the arbitrary pixel position 200a according to the vertical uniformity pixel number Nv.

[0448] Please continue to refer to Fig.33 The demosaic processing unit 620 also includes: a color image acquisition unit 627, which is used to acquire the pixel of each pixel position 200a in the horizontal demosaic color image 250 or the vertical demosaic color image 290 according to the size relationship between the horizontal color difference uniformity parameter homo_h and the vertical color difference uniformity parameter homo_v of each pixel position 200a to form a color image 300.

[0449] Specifically, the color image acquisition unit 627 in this embodiment is used to: when the horizontal color difference uniformity parameter homo_h of any pixel position 200a is greater than or equal to the vertical color difference uniformity parameter homo_v, acquire the pixel of the arbitrary pixel position 200a according to the pixel of the horizontal demosaiced color image 250 at the arbitrary pixel position 200a; and when the horizontal color difference uniformity parameter homo_h of any pixel position 200a is less than the vertical color difference uniformity parameter homo_v, acquire the pixel of the arbitrary pixel position 200a according to the pixel of the vertical demosaiced color image 290 at the arbitrary pixel position 200a.

[0450] It should be understood that in this embodiment, since the horizontal red pixel channel image 250a, the horizontal green pixel channel image 250b and the horizontal blue pixel channel image 250c are merged to form a horizontal demosaiced color image 250, and the vertical red pixel channel image 290a, the vertical green pixel channel image 290b and the vertical blue pixel channel image 290c are merged to form a vertical demosaiced color image 290, the pixels of the color image 300 at each pixel position 200a include: red pixels, green pixels and blue pixels.

[0451] Similarly, in some other embodiments, since the horizontal red pixel channel image 250a, the horizontal green pixel channel image 250b, the horizontal blue pixel channel image 250c and the horizontal white pixel interpolation image 220 are merged to form a horizontal demosaiced color image, and the vertical red pixel channel image 290a, the vertical green pixel channel image 290b, the vertical blue pixel channel image 290c and the vertical white pixel interpolation image 260 are merged to form a vertical demosaiced color image, the pixels of the color image at each pixel position include: red pixels, green pixels, blue pixels and white pixels.

[0452] Please continue to refer to Fig.33 The color image processing device 600 also includes: a pixel value uniformity restoration module 630, which is used to perform restoration processing on the color image 300 to form a restored color image 310, and the restoration processing includes: adjusting each red pixel (not shown) of the color image 300 according to the first adjustment coefficient coefR to form a corresponding restored red pixel (not shown), and adjusting each green pixel (not shown) of the color image 300 according to the second adjustment coefficient coefG to form a corresponding restored green pixel (not shown), and adjusting each blue pixel (not shown) of the color image 300 according to the third adjustment coefficient coefB to form a corresponding restored blue pixel (not shown).

[0453] Similarly, in some other embodiments, when the color image also includes a channel of white pixels, the pixel value uniformity restoration module is used to perform restoration processing on the color image to form a restored color image, and the restoration processing includes: adjusting each red pixel (not shown) of the color image 300 according to the first adjustment coefficient coefR to form a corresponding restored red pixel (not shown), and adjusting each green pixel (not shown) of the color image 300 according to the second adjustment coefficient coefG to form a corresponding restored green pixel (not shown), and adjusting each blue pixel (not shown) of the color image 300 according to the third adjustment coefficient coefB to form a corresponding restored blue pixel (not shown), and adjusting each white pixel of the color image according to the fourth adjustment coefficient coefW to form a corresponding restored white pixel.

[0454] Those skilled in the art should understand that the color image processing device 600 provided in this embodiment is Figures 19 to 32 The color image processing method provided in the embodiment shown in the figure is complementary to each other in terms of specific implementation principle and logic. Figures 19 to 32 The relevant description in the illustrated embodiment will not be repeated here.

[0455] In this embodiment, the color image processing device 600 further includes: an image output unit 640 , configured to output the restored color image 310 .

[0456] In some other embodiments, the image output unit is used to directly output the color image 300 .

[0457] Although the present invention is disclosed as above, the present invention is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the scope defined by the claims.

Claims

1. A color image processing method, characterized in that: include: Acquire a mosaic image to be processed, wherein the mosaic image to be processed includes a plurality of initial white pixels and a plurality of initial color pixels arranged in a two-dimensional array at a plurality of pixel positions, and the initial white pixels and the initial color pixels are arranged alternately in both the horizontal direction and the vertical direction; According to the initial white pixels on both sides of each initial color pixel along the horizontal direction, a first interpolation process is performed on the pixel position where each initial color pixel is located to obtain a horizontal white pixel interpolation image; Acquire a horizontal demosaiced color image according to the horizontal white pixel interpolation image and the mosaic image to be processed; According to the initial white pixels on both sides of each initial color pixel along the vertical direction, a second interpolation process is performed on the pixel position where each initial color pixel is located to obtain a vertical white pixel interpolation image; Acquire a vertical demosaiced color image according to the vertical white pixel interpolation image and the mosaic image to be processed; According to the horizontal demosaiced color image and the vertical demosaiced color image, acquiring a horizontal color difference uniformity parameter and a vertical color difference uniformity parameter of each pixel position; According to the magnitude relationship between the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter at each pixel position, in the horizontal demosaiced color image or the vertical demosaiced color image, a pixel at each pixel position is acquired to form a color image; The horizontal color difference uniformity parameter of each pixel position is obtained according to the horizontal brightness component and the horizontal chromaticity component of each pixel position, the horizontal brightness components and the horizontal chromaticity components of multiple pixel positions within a preset uniformity window range centered on each pixel position, and the color difference uniformity threshold of each pixel position; The vertical color difference uniformity parameter of each pixel position is obtained based on the vertical brightness component and vertical chromaticity component of each pixel position, the vertical brightness components and vertical chromaticity components of multiple pixel positions within a preset uniformity window range centered on each pixel position, and the color difference uniformity threshold of each pixel position.

2. The color image processing method according to claim 1, characterized in that: The multiple initial color pixels include multiple initial red pixels, multiple initial green pixels and multiple initial blue pixels, and before performing the first interpolation processing and the second interpolation processing, the color image processing method also includes: performing pixel value uniformity processing on the mosaic image to be processed to obtain an adjusted mosaic image, and the adjusted mosaic image includes multiple adjusted red pixels, multiple adjusted green pixels, multiple adjusted blue pixels and multiple adjusted white pixels with equal average pixel values.

3. The color image processing method according to claim 2, characterized in that: The method for performing pixel value uniformity processing on the mosaic image to be processed includes: Obtaining an average pixel value of the plurality of initial red pixels; Obtaining an average pixel value of the plurality of initial green pixels; Obtaining an average pixel value of the plurality of initial blue pixels; Obtaining an average pixel value of the plurality of initial white pixels; Obtaining a first adjustment coefficient, a second adjustment coefficient, a third adjustment coefficient, and a fourth adjustment coefficient according to an average pixel value of the plurality of initial red pixels, an average pixel value of the plurality of initial green pixels, an average pixel value of the plurality of initial blue pixels, and an average pixel value of the plurality of initial white pixels; adjusting the pixel value of each initial red pixel according to the first adjustment coefficient to form a corresponding adjusted red pixel; adjusting the pixel value of each initial green pixel according to the second adjustment coefficient to form a corresponding adjusted green pixel; adjusting the pixel value of each initial blue pixel according to the third adjustment coefficient to form a corresponding adjusted blue pixel; adjusting the pixel value of each initial white pixel according to the fourth adjustment coefficient to form a corresponding adjusted white pixel; An average pixel value of the plurality of adjusted red pixels, an average pixel value of the plurality of adjusted green pixels, an average pixel value of the plurality of adjusted blue pixels, and an average pixel value of the plurality of adjusted white pixels are equal.

4. The color image processing method according to claim 3, characterized in that: At least one of the first adjustment coefficient, the second adjustment coefficient, the third adjustment coefficient and the fourth adjustment coefficient is 1.

5. The color image processing method according to claim 3, characterized in that: The pixels of the color image at each pixel position include red pixels, green pixels and blue pixels; The color image processing method further includes: performing restoration processing on the color image to form a restored color image, wherein the restoration processing includes: adjusting each red pixel of the color image according to the first adjustment coefficient to form a corresponding restored red pixel; adjusting each green pixel of the color image according to the second adjustment coefficient to form a corresponding restored green pixel; Each blue pixel of the color image is adjusted according to the third adjustment coefficient to form a corresponding restored blue pixel.

6. The color image processing method according to claim 5, characterized in that: The pixels of the color image at each pixel position also include white pixels; the restoration process also includes: adjusting each white pixel of the color image according to a fourth adjustment coefficient to form a corresponding restored white pixel.

7. The color image processing method according to claim 2, characterized in that: The first interpolation process includes: according to the horizontal direction, i The pixel values ​​W1 of the two adjusted white pixels corresponding to the two adjacent initial white pixels i and pixel value W2 i , obtain the initial color pixel C i The horizontal white pixel interpolation Wh at the pixel position i =(W1 i +W2 i ) / 2; with the initial color pixel C i The horizontal white pixel interpolation Wh at the pixel position i , interpolate to the same pixel position in the adjusted mosaic image.

8. The color image processing method according to claim 2, characterized in that: The second interpolation process includes: according to the vertical direction, i The pixel values ​​of the two adjusted white pixels corresponding to the two adjacent initial white pixels are W3 i and pixel value W4 i , obtain the initial color pixel C i The vertical white pixel interpolation Wv at the pixel position i =(W3 i +W4 i ) / 2; with the initial color pixel C i The vertical white pixel interpolation Wv at the pixel position i , interpolate to the same pixel position in the adjusted mosaic image.

9. The color image processing method according to claim 2, characterized in that: According to the horizontal white pixel interpolation image and the mosaic image to be processed, the method for obtaining a horizontal demosaic color image comprises: performing pixel value subtraction processing on the adjusted mosaic image and the horizontal white pixel interpolation image at each pixel position to obtain a horizontal slowly changing mosaic image, wherein the horizontal slowly changing mosaic image comprises a plurality of horizontal slowly changing red pixels, a plurality of horizontal slowly changing green pixels and a plurality of horizontal slowly changing blue pixels; According to the plurality of horizontal slowly changing red pixels, performing a third interpolation process on the horizontal slowly changing mosaic image to obtain a horizontal slowly changing red pixel channel image, wherein each pixel position of the horizontal slowly changing red pixel channel image has one initial horizontal red pixel; Performing pixel-by-pixel addition processing on the horizontal white pixel interpolation image and the horizontal slowly varying red pixel channel image to obtain a horizontal red pixel channel image; According to the plurality of horizontal slowly varying green pixels, a fourth interpolation process is performed on the horizontal slowly varying mosaic image to obtain a horizontal slowly varying green pixel channel image, wherein each pixel position of the horizontal slowly varying green pixel channel image has one initial horizontal green pixel; Performing pixel-by-pixel addition processing on the horizontal white pixel interpolation image and the horizontal slowly varying blue pixel channel image to obtain a horizontal blue pixel channel image; According to the plurality of horizontal slowly varying blue pixels, a fifth interpolation process is performed on the horizontal slowly varying mosaic image to obtain a horizontal slowly varying blue pixel channel image, wherein each pixel position of the horizontal slowly varying blue pixel channel image has one initial horizontal blue pixel; Performing pixel-by-pixel addition processing on the horizontal white pixel interpolation image and the horizontal slowly varying blue pixel channel image to obtain a horizontal blue pixel channel image; The horizontal red pixel channel image, the horizontal green pixel channel image and the horizontal blue pixel channel image are combined to form a horizontal demosaiced color image.

10. The color image processing method according to claim 9, characterized in that: The method for obtaining a horizontal demosaic color image further includes: merging the horizontal red pixel channel image, the horizontal green pixel channel image, the horizontal blue pixel channel image and the horizontal white pixel interpolation image to form the horizontal demosaic color image.

11. The color image processing method according to claim 9, characterized in that: According to the vertical white pixel interpolation image and the mosaic image to be processed, the method for obtaining a vertical demosaiced color image comprises: performing pixel value subtraction processing on the adjusted mosaic image and the vertical white pixel interpolation image at each pixel position to obtain a vertical slowly varying mosaic image, wherein the vertical slowly varying mosaic image comprises a plurality of vertical slowly varying red pixels, a plurality of vertical slowly varying green pixels, and a plurality of vertical slowly varying blue pixels; According to the plurality of vertical slowly changing red pixels, a sixth interpolation process is performed on the vertical slowly changing mosaic image to obtain a vertical slowly changing red pixel channel image, wherein each pixel position of the vertical slowly changing red pixel channel image has one initial vertical red pixel; Performing pixel-by-pixel addition processing on the vertical white pixel interpolation image and the vertical slowly varying red pixel channel image to obtain a vertical red pixel channel image; According to the plurality of vertical slowly varying green pixels, a seventh interpolation process is performed on the vertical slowly varying mosaic image to obtain a vertical slowly varying green pixel channel image, wherein each pixel position of the vertical slowly varying green pixel channel image has one initial vertical green pixel; Performing pixel-by-pixel addition processing on the vertical white pixel interpolation image and the vertical slowly varying green pixel channel image to obtain a vertical green pixel channel image; performing an eighth interpolation process on the vertical slowly varying mosaic image according to the plurality of vertical slowly varying blue pixels to obtain a vertical slowly varying blue pixel channel image, wherein each pixel position of the vertical slowly varying blue pixel channel image has one initial vertical blue pixel; Performing pixel-by-pixel addition processing on the vertical white pixel interpolation image and the vertical slowly varying blue pixel channel image to obtain a vertical blue pixel channel image; The vertical red pixel channel image, the vertical green pixel channel image and the vertical blue pixel channel image are combined to form the vertical demosaiced color image.

12. The color image processing method according to claim 11, characterized in that: The method for obtaining a vertical demosaiced color image further includes: merging the vertical red pixel channel image, the vertical green pixel channel image, the vertical blue pixel channel image and the vertical white pixel interpolation image to form the vertical demosaiced color image.

13. The color image processing method according to claim 12, characterized in that: The third interpolation process, the fourth interpolation process, the fifth interpolation process, the sixth interpolation process, the seventh interpolation process and the eighth interpolation process are performed in the same manner.

14. The color image processing method according to claim 13, characterized in that: The third interpolation processing, the fourth interpolation processing, the fifth interpolation processing, the sixth interpolation processing, the seventh interpolation processing and the eighth interpolation processing methods include: bilinear interpolation processing, bicubic interpolation processing, mean filter interpolation processing or median filter interpolation processing.

15. The color image processing method according to claim 1, characterized in that: According to the horizontal demosaiced color image and the vertical demosaiced color image, a method for obtaining a horizontal color difference uniformity parameter and a vertical color difference uniformity parameter at each pixel position includes: Performing color space conversion on the horizontal demosaiced color image to obtain a horizontal brightness component and a horizontal chrominance component at each pixel position; Performing color space conversion on the vertical demosaiced color image to obtain a vertical brightness component and a vertical chrominance component at each pixel position; Obtaining a color difference uniformity threshold value at each pixel position according to the horizontal brightness component and the horizontal chromaticity component of the pixel positions on both sides of each pixel position along the horizontal direction, the vertical brightness component and the vertical chromaticity component of the pixel positions on both sides of each pixel position along the vertical direction, and the horizontal brightness component, the horizontal chromaticity component, the vertical brightness component, and the vertical chromaticity component of each pixel position; Acquire a horizontal color difference uniformity parameter for each pixel position according to a horizontal brightness component and a horizontal chrominance component of each pixel position, horizontal brightness components and horizontal chrominance components of multiple pixel positions within a preset uniformity window range centered on each pixel position, and a color difference uniformity threshold of each pixel position; A vertical color difference uniformity parameter of each pixel position is obtained according to the vertical brightness component and the vertical chromaticity component of each pixel position, the vertical brightness components and the vertical chromaticity components of multiple pixel positions within a preset uniformity window range centered on each pixel position, and the color difference uniformity threshold of each pixel position.

16. The color image processing method according to claim 15, characterized in that: The pixels of the horizontal demosaiced color image at each pixel position include at least horizontal red pixels, horizontal green pixels and horizontal blue pixels, the pixels of the vertical demosaiced color image at each pixel position include at least vertical red pixels, vertical green pixels and vertical blue pixels, and the horizontal chroma component of each pixel position includes a first horizontal chroma component and a second horizontal chroma component, and the vertical chroma component of each pixel position includes a first vertical chroma component and a second vertical chroma component.

17. The color image processing method according to claim 16, characterized in that: The method for obtaining the color difference uniformity threshold value of each pixel position comprises: According to any pixel position [x i ,y i ], and the pixel position [x i ,y i ]The pixel positions on both sides of the horizontal direction [x i -1,y i ] and pixel position [x i +1,y i ] horizontal luminance component, the first horizontal chrominance component and the second horizontal chrominance component, obtain the pixel position [x i ,y i ] contains the specified level of brightness color difference eH_h [xi,yi] ; According to any pixel position [x i ,y i ], and the pixel position [x i ,y i ] The pixel positions on both sides of the vertical direction [x i ,y i -1] and the pixel position [x i ,y i +1], the vertical luminance component, the first vertical chrominance component and the second vertical chrominance component, and obtain the pixel position [x i ,y i ] specifies the vertical brightness color difference eH_v [xi,yi] ; Compare the specified level of brightness color difference eH_h [xi,yi] And specify the vertical brightness color difference eH_v [xi,yi] , get the pixel position [x i ,y i ] color difference uniformity threshold he [xi,yi] =min(eH_h [xi,yi] ,eH_v [xi,yi] )。 18. The color image processing method according to claim 17, characterized in that: The pixel position [x i ,y i ] contains the specified level of brightness color difference eH_h [xi,yi] The methods include: According to the pixel position [x i ,y i ] and pixel position [x i -1,y i ] horizontal luminance component, the first horizontal chrominance component and the second horizontal chrominance component, and obtain the pixel position [x i ,y i ] and pixel position [x i -1,y i ] between the horizontal brightness color difference △Eh [xi,yi],[xi-1,yi ]; According to the pixel position [x i ,y i ] and pixel position [x i +1,y i ] horizontal luminance component, the first horizontal chrominance component and the second horizontal chrominance component, and obtain the pixel position [x i ,y i ] and pixel position [x i +1,y i ] between the horizontal brightness color difference △Eh [xi,yi],[xi+1,yi] ; According to the horizontal brightness color difference △Eh [xi,yi],[xi-1,yi] and horizontal brightness color difference △Eh [xi,yi],[xi+1,yi] , get the pixel position [x i ,y i ] contains the specified level of brightness difference eH_h [xi,yi] =max(△Eh [xi,yi],[xi-1,yi] ,△Eh [xi,yi],[xi+1,yi] )。 19. The color image processing method according to claim 18, characterized in that: Get any pixel position [x i ,y i ] and another arbitrary pixel position [x j ,y j ] between the horizontal brightness color difference △Eh [xi,yi],[xj,yj] The method includes: according to the pixel position [x i ,y i ] horizontal luminance component Lh [xi,yi] , the first horizontal chrominance component Ah [xi,yi] and the second horizontal chrominance component Bh [xi,yi] , and the pixel position [x j ,y j ] horizontal luminance component Lh [xj,yj] , the first horizontal chrominance component Ah [xj,yj] and the second horizontal chrominance component Bh [xj,yj] , get in, αh [xi,yi],[xj,yj] =(Lh [xi,yi] -Lh [xj,yj] ) 2 , βh [xi,yi],[xj,yj] =(Ah [xi,yi] -Ah [xj,yj] ) 2 , and γh [xi,yi],[xj,yj] =(Bh [xi,yi] -Bh [xj,yj] ) 2 .

20. The color image processing method according to claim 17, characterized in that: The pixel position [x i ,y i ] specifies the vertical brightness color difference eH_v [xi,yi] The methods include: According to the pixel position [x i ,y i ] and pixel position [x i ,y i -1], the vertical luminance component, the first vertical chrominance component, and the second vertical chrominance component, and obtain the pixel position [x i ,y i ] and pixel position [x i ,y i -1] between the vertical brightness color difference △Ev [xi,yi],[xi,yi-1] ; According to the pixel position [x i ,y i ] and pixel position [x i ,y i +1], the vertical luminance component, the first vertical chrominance component, and the second vertical chrominance component, and obtain the pixel position [x i ,y i ] and pixel position [x i ,y i +1] between the vertical brightness color difference △Ev [xi,yi],[xi,yi+1] ; According to the vertical brightness color difference △Ev [xi,yi],[xi,yi-1] And vertical brightness color difference △Ev [xi,yi],[xi,yi+1] , get the pixel position [x i ,y i ] specifies the vertical brightness color difference eH_v [xi,yi] =max(△Ev [xi,yi],[xi,yi-1] ,△Ev [xi,yi],[xi,yi+1] ).

21. The color image processing method according to claim 20, characterized in that: Get any pixel position [x i ,y i ] and another arbitrary pixel position [x j ,y j ] between the vertical brightness color difference △Ev [xi,yi],[xj,yj] The method includes: according to the pixel position [x i ,y i ]’s vertical luminance component Lv [xi,yi] , the first vertical chrominance component Av [xi,yi] and the second vertical chrominance component Bv [xi,yi] , and the pixel position [x j ,y j ]’s vertical luminance component Lv [xj,yj] , the first vertical chrominance component Av [xj,yj] and the second vertical chrominance component Bv [xj,yj] , get in, αv [xi,yi],[xj,yj] =(Lv [xi,yi] -Lv [xj,yj] ) 2 , βv [xi,yi],[xj,yj] =(Off [xi,yi] -Of [xj,yj] ) 2 , And γv [Xi,yi],[xj,yj] =(Bv [xi,yi] -Bv [xj,yj] ) 2 .

22. The color image processing method according to claim 15, characterized in that: The method for obtaining the horizontal color difference uniformity parameter of each pixel position further comprises: Obtain N horizontal luminance color differences between the arbitrary pixel position and each pixel position in the N pixel positions according to the horizontal luminance component and the horizontal chrominance component of the arbitrary pixel position and the horizontal luminance components and the horizontal chrominance components of the N pixel positions within a preset uniformity window centered on the arbitrary pixel position; Compare the N horizontal luminance color differences with the color difference uniformity threshold of the arbitrary pixel position respectively to obtain the horizontal uniformity pixel number Nh, wherein the horizontal uniformity pixel number Nh is: the number of horizontal luminance color differences that are less than or equal to the color difference uniformity threshold of the arbitrary pixel position among the N horizontal luminance color differences; According to the horizontal uniformity pixel number Nh, a horizontal color difference uniformity parameter homo_h=Nh / N of the arbitrary pixel position is obtained.

23. The color image processing method according to claim 16, characterized in that: The method for obtaining the vertical color difference uniformity parameter of each pixel position further comprises: Obtaining N vertical luminance color differences between the arbitrary pixel position and each pixel position in the N pixel positions according to the vertical luminance component and the vertical chrominance component of the arbitrary pixel position and each vertical luminance component and each vertical chrominance component of the N pixel positions within a preset uniformity window range centered on the arbitrary pixel position; Compare the N vertical luminance color differences with the color difference uniformity threshold of the arbitrary pixel position respectively to obtain the vertical uniformity pixel number Nv, wherein the vertical uniformity pixel number Nv is: the number of vertical luminance color differences that are less than or equal to the color difference uniformity threshold of the arbitrary pixel position among the N vertical luminance color differences; According to the vertical uniformity pixel number Nv, a vertical color difference uniformity parameter homo_v=Nv / N at the arbitrary pixel position is obtained.

24. The color image processing method according to claim 23, characterized in that: The method of obtaining a pixel at each pixel position in a horizontal demosaiced color image or a vertical demosaiced color image according to the size relationship between the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position to form a color image includes: When the horizontal color difference uniformity parameter at any pixel position is greater than or equal to the vertical color difference uniformity parameter, acquiring a pixel at the arbitrary pixel position according to the pixel of the horizontal demosaiced color image at the arbitrary pixel position; When the horizontal color difference uniformity parameter at any pixel position is less than the vertical color difference uniformity parameter, the pixel at the arbitrary pixel position is acquired according to the pixel of the vertical demosaiced color image at the arbitrary pixel position.

25. A color image processing device using any color image processing method according to any one of claims 1 to 24, characterized in that: include: A color image sensor, used for acquiring a mosaic image to be processed, wherein the mosaic image to be processed comprises a plurality of initial white pixels and a plurality of initial color pixels arranged in a two-dimensional array at a plurality of pixel positions, and the initial white pixels and the initial color pixels are arranged alternately in both the horizontal direction and the vertical direction; A de-mosaic processing unit is used to perform de-mosaic processing on the mosaic image to be processed to obtain a color image, comprising: A first interpolation processing module, configured to perform a first interpolation processing on a pixel position where each initial color pixel is located according to initial white pixels on both sides of each initial color pixel along a horizontal direction, so as to obtain a horizontal white pixel interpolation image; A horizontal demosaic color image acquisition unit, used for acquiring a horizontal demosaic color image according to the horizontal white pixel interpolation image and the mosaic image to be processed; A second interpolation processing module, used to perform a second interpolation processing on the pixel position where each initial color pixel is located according to initial white pixels on both sides of each initial color pixel along the vertical direction, so as to obtain a vertical white pixel interpolation image; A vertical demosaiced color image acquisition unit, configured to acquire a vertical demosaiced color image according to the vertical white pixel interpolation image and the mosaic image to be processed; A color difference uniformity parameter acquisition unit, used to acquire a horizontal color difference uniformity parameter and a vertical color difference uniformity parameter of each pixel position according to the horizontal demosaiced color image and the vertical demosaiced color image; The color image acquisition unit is used to acquire the pixel at each pixel position in the horizontal demosaiced color image or the vertical demosaiced color image according to the size relationship between the horizontal color difference uniformity parameter and the vertical color difference uniformity parameter of each pixel position to form a color image.

26. The color image processing device according to claim 25, characterized in that: The multiple initial color pixels include multiple initial red pixels, multiple initial green pixels and multiple initial blue pixels, and the color image processing device also includes: a pixel value uniformity adjustment unit, used to perform pixel value uniformity processing on the mosaic image to be processed to obtain an adjusted mosaic image, wherein the adjusted mosaic image includes multiple adjusted red pixels, multiple adjusted green pixels, multiple adjusted blue pixels and multiple adjusted white pixels with equal average pixel values.

27. The color image processing device according to claim 26, characterized in that: The pixel value uniformity adjustment unit comprises: an average pixel value acquisition module, used to acquire an average pixel value of the plurality of initial red pixels, an average pixel value of the plurality of initial green pixels, an average pixel value of the plurality of initial blue pixels, and an average pixel value of the plurality of initial white pixels; an adjustment coefficient acquisition module, configured to acquire a first adjustment coefficient, a second adjustment coefficient, a third adjustment coefficient, and a fourth adjustment coefficient according to an average pixel value of the plurality of initial red pixels, an average pixel value of the plurality of initial green pixels, an average pixel value of the plurality of initial blue pixels, and an average pixel value of the plurality of initial white pixels; A uniformity adjustment module is used to adjust the pixel value of each initial red pixel according to the first adjustment coefficient to form a corresponding adjusted red pixel, and to adjust the pixel value of each initial green pixel according to the second adjustment coefficient to form a corresponding adjusted green pixel, and to adjust the pixel value of each initial blue pixel according to the third adjustment coefficient to form a corresponding adjusted blue pixel, and to adjust the pixel value of each initial white pixel according to the fourth adjustment coefficient to form a corresponding adjusted white pixel, so that the average pixel value of the multiple adjusted red pixels, the average pixel value of the multiple adjusted green pixels, the average pixel value of the multiple adjusted blue pixels, and the average pixel value of the multiple adjusted white pixels are equal.

28. The color image processing device according to claim 26, characterized in that: The pixels of the color image at each pixel position include red pixels, green pixels and blue pixels. The color image processing device also includes: a pixel value uniformity restoration module, which is used to perform restoration processing on the color image to form a restored color image. The restoration processing includes: adjusting each red pixel of the color image according to a first adjustment coefficient to form a corresponding restored red pixel, and adjusting each green pixel of the color image according to a second adjustment coefficient to form a corresponding restored green pixel, and adjusting each blue pixel of the color image according to a third adjustment coefficient to form a corresponding restored blue pixel.

29. The color image processing device according to claim 26, characterized in that: The pixels of the color image at each pixel position include red pixels, green pixels, blue pixels and white pixels. The color image processing device also includes: a pixel value uniformity restoration module, which is used to perform restoration processing on the color image to form a restored color image. The restoration processing includes: adjusting each red pixel of the color image according to a first adjustment coefficient to form a corresponding restored red pixel, and adjusting each green pixel of the color image according to a second adjustment coefficient to form a corresponding restored green pixel, and adjusting each blue pixel of the color image according to a third adjustment coefficient to form a corresponding restored blue pixel, and adjusting each white pixel of the color image according to a fourth adjustment coefficient to form a corresponding restored white pixel.

30. The color image processing device according to claim 26, wherein: The horizontal demosaic color image acquisition unit comprises: A horizontal slowly varying mosaic image acquisition module is used to perform pixel value subtraction processing on the adjusted mosaic image and the horizontal white pixel interpolation image at each pixel position to acquire a horizontal slowly varying mosaic image, wherein the horizontal slowly varying mosaic image includes a plurality of horizontal slowly varying red pixels, a plurality of horizontal slowly varying green pixels, and a plurality of horizontal slowly varying blue pixels; a horizontal slowly changing red pixel channel image acquisition module, which performs a third interpolation process on the horizontal slowly changing mosaic image according to the plurality of horizontal slowly changing red pixels, to acquire a horizontal slowly changing red pixel channel image, wherein each pixel position of the horizontal slowly changing red pixel channel image has one initial horizontal red pixel; A horizontal red pixel channel image acquisition module is used to perform pixel-by-pixel addition processing on the horizontal white pixel interpolation image and the horizontal slowly varying red pixel channel image to acquire a horizontal red pixel channel image; A horizontal slowly varying green pixel channel image acquisition module, configured to perform a fourth interpolation process on the horizontal slowly varying mosaic image according to the plurality of horizontal slowly varying green pixels, to acquire a horizontal slowly varying green pixel channel image, wherein each pixel position of the horizontal slowly varying green pixel channel image has one initial horizontal green pixel; A horizontal green pixel channel image acquisition module is used to perform pixel-by-pixel addition processing on the horizontal white pixel interpolation image and the horizontal slowly varying green pixel channel image to acquire a horizontal green pixel channel image; A horizontal slowly varying blue pixel channel image acquisition module is used to perform a fifth interpolation process on the horizontal slowly varying mosaic image according to the plurality of horizontal slowly varying blue pixels to acquire a horizontal slowly varying blue pixel channel image, wherein each pixel position of the horizontal slowly varying blue pixel channel image has one initial horizontal blue pixel; A horizontal blue pixel channel image acquisition module is used to perform pixel-by-pixel addition processing on the horizontal white pixel interpolation image and the horizontal slowly varying blue pixel channel image to acquire a horizontal blue pixel channel image; The horizontal merging module is used to merge at least the horizontal red pixel channel image, the horizontal green pixel channel image and the horizontal blue pixel channel image to form a horizontal demosaiced color image.

31. The color image processing device according to claim 30, characterized in that: The horizontal merging module is used to merge the horizontal red pixel channel image, the horizontal green pixel channel image, the horizontal blue pixel channel image and the horizontal white pixel interpolation image to form a horizontal demosaiced color image.

32. The color image processing device according to claim 30, characterized in that: The vertical demosaic color image acquisition unit comprises: A vertical slowly varying mosaic image acquisition module, used for performing pixel value subtraction processing on the adjusted mosaic image and the vertical white pixel interpolation image at each pixel position to acquire a vertical slowly varying mosaic image, wherein the vertical slowly varying mosaic image includes a plurality of vertical slowly varying red pixels, a plurality of vertical slowly varying green pixels, and a plurality of vertical slowly varying blue pixels; A vertical slowly changing red pixel channel image acquisition module is used to perform a sixth interpolation process on the vertical slowly changing mosaic image according to the plurality of vertical slowly changing red pixels to acquire a vertical slowly changing red pixel channel image, wherein each pixel position of the vertical slowly changing red pixel channel image has one initial vertical red pixel; A vertical red pixel channel image acquisition module, used for performing pixel-by-pixel addition processing on the vertical white pixel interpolation image and the vertical slowly varying red pixel channel image to acquire a vertical red pixel channel image; A vertical slowly varying green pixel channel image acquisition module, configured to perform a seventh interpolation process on the vertical slowly varying mosaic image according to the plurality of vertical slowly varying green pixels, to acquire a vertical slowly varying green pixel channel image, wherein each pixel position of the vertical slowly varying green pixel channel image has one initial vertical green pixel; A vertical green pixel channel image acquisition module is used to perform pixel-by-pixel addition processing on the vertical white pixel interpolation image and the vertical slowly varying green pixel channel image to acquire a vertical green pixel channel image; A vertical slowly varying blue pixel channel image acquisition module, configured to perform an eighth interpolation process on the vertical slowly varying mosaic image according to the plurality of vertical slowly varying blue pixels, to acquire a vertical slowly varying blue pixel channel image, wherein each pixel position of the vertical slowly varying blue pixel channel image has one initial vertical blue pixel; A vertical blue pixel channel image acquisition module, used for performing pixel-by-pixel addition processing on the vertical white pixel interpolation image and the vertical slowly varying blue pixel channel image to acquire a vertical blue pixel channel image; A vertical merging module is used to merge at least the vertical red pixel channel image, the vertical green pixel channel image and the vertical blue pixel channel image to form the vertical demosaiced color image.

33. The color image processing device according to claim 32, characterized in that: The vertical merging module is used to merge the vertical red pixel channel image, the vertical green pixel channel image, the vertical blue pixel channel image and the vertical white pixel interpolation image to form the vertical demosaiced color image.

34. The color image processing device according to claim 25, characterized in that: The color difference uniformity parameter acquisition unit includes: A color space conversion module, configured to perform color space conversion on the horizontal demosaiced color image to obtain a horizontal brightness component and a horizontal chrominance component at each pixel position, and to perform color space conversion on the vertical demosaiced color image to obtain a vertical brightness component and a vertical chrominance component at each pixel position; a color difference uniformity threshold acquisition unit, configured to acquire a color difference uniformity threshold of each pixel position according to the horizontal brightness component and the horizontal chromaticity component of the pixel positions on both sides of each pixel position along the horizontal direction, the vertical brightness component and the vertical chromaticity component of the pixel positions on both sides of each pixel position along the vertical direction, and the horizontal brightness component, the horizontal chromaticity component, the vertical brightness component and the vertical chromaticity component of each pixel position; A horizontal color difference uniformity parameter acquisition module, used to acquire a horizontal color difference uniformity parameter of each pixel position according to a horizontal brightness component and a horizontal chromaticity component of each pixel position, horizontal brightness components and horizontal chromaticity components of multiple pixel positions within a preset uniformity window range centered on each pixel position, and a color difference uniformity threshold of each pixel position; A vertical color difference uniformity parameter acquisition module is used to acquire the vertical color difference uniformity parameter of each pixel position according to the vertical brightness component and the vertical chromaticity component of each pixel position, the vertical brightness components and the vertical chromaticity components of multiple pixel positions within a preset uniformity window range centered on each pixel position, and the color difference uniformity threshold of each pixel position.

35. The color image processing device according to claim 34, characterized in that: The horizontal color difference uniformity parameter acquisition module is further used to: acquire N horizontal luminance color differences between the arbitrary pixel position and each pixel position in the N pixel positions according to the horizontal luminance component and the horizontal chrominance component of the arbitrary pixel position and the horizontal luminance components and the horizontal chrominance components of the N pixel positions within the preset uniformity window range centered on the arbitrary pixel position; And, the N horizontal luminance color differences are compared with the color difference uniformity threshold of the arbitrary pixel position respectively to obtain the horizontal uniformity pixel number Nh, and the horizontal uniformity pixel number Nh is: the number of horizontal luminance color differences that are less than or equal to the color difference uniformity threshold of the arbitrary pixel position among the N horizontal luminance color differences; and, according to the horizontal uniformity pixel number Nh, the horizontal color difference uniformity parameter homo_h=Nh / N of the arbitrary pixel position is obtained.

36. The color image processing device according to claim 35, characterized in that: The vertical color difference uniformity parameter acquisition module is further used to: acquire N vertical luminance-containing color differences between the arbitrary pixel position and each of the N pixel positions according to the vertical luminance component and the vertical chrominance component of the arbitrary pixel position, and each vertical luminance component and each vertical chrominance component of the N pixel positions within a preset uniformity window range centered on the arbitrary pixel position; and, compare the N vertical luminance-containing color differences with the color difference uniformity threshold of the arbitrary pixel position respectively to acquire a vertical uniformity pixel number Nv, wherein the vertical uniformity pixel number Nv is: the number of vertical luminance-containing color differences among the N vertical luminance-containing color differences that are less than or equal to the color difference uniformity threshold of the arbitrary pixel position; and, acquire a vertical color difference uniformity parameter homo_v=Nv / N of the arbitrary pixel position according to the vertical uniformity pixel number Nv.

37. The color image processing device according to claim 36, characterized in that: The color image acquisition unit is further used to: when the horizontal color difference uniformity parameter of any pixel position is greater than or equal to the vertical color difference uniformity parameter, acquire the pixel at the arbitrary pixel position according to the pixel of the horizontal demosaiced color image at the arbitrary pixel position; and when the horizontal color difference uniformity parameter of any pixel position is less than the vertical color difference uniformity parameter, acquire the pixel at the arbitrary pixel position according to the pixel of the vertical demosaiced color image at the arbitrary pixel position.