Methods, devices and computer program products for demosaicing an image captured by an image sensor comprising a color filter array
AssigneeSony Mobile Communications Inc.
InventorsHåkan Grahn, Stefan Petersson, Jim Rasmusson
Life of this patent
Estimating the term…
Abstract
The present disclosure generally relates to the field of demosaicing an image captured by an image sensor including a color filter array, and more specifically relate to such a demosaicing operation using the GPU, shaders of the GPU and built-in rasterization function of the GPU.
Claims15
A method for demosaicing an image captured by an image sensor comprising a color filter array, the method comprising:
- receiving, by a graphical processing unit (GPU), a texture corresponding to the captured image, the texture having a mosaic pattern with a first, second and third color, each pixel in the texture having a color component from only one color of said first, second and third color, wherein 25% of the pixels in the texture have a color component from the first color, wherein 25% of the pixels in the texture have a color component from the second color, wherein 50% of the pixels in the texture have a color component from the third color;
- from the texture, defining four grids, each grid defining a plurality of pixel positions in the texture, wherein a first grid define pixel positions of all pixels of the texture having a color component from the first color, wherein a second grid define pixel positions of all pixels of the texture having a color component from the second color, wherein a third grid define pixel positions of 50% of the pixels of the texture having a color component from the third color, wherein a fourth grid define pixel positions of a remaining 50% of the pixels of the texture having a color component from the third color;
- for each grid and each pixel position in the grid, initiating a vertex shader of the GPU and providing as an input to the vertex shader the pixel position, wherein the vertex shader extracts the color component corresponding to the pixel position in the texture and outputs the pixel position and the corresponding color component of the pixel position;
- for each grid and using the output from the vertex shaders, defining a plurality of instances of a patch primitive type, each instance of the patch primitive type comprising four pixel positions forming a quad, and the color component corresponding to each of the four pixel positions;
- for each instance of the patch primitive type, initiating a geometry shader of the GPU, and providing as a input to the geometry shader the instance of the patch primitive type, wherein the geometry shader define two instances of a triangle primitive type from the instance of the patch primitive type based on an order of the pixel positions comprised in the instance of the patch primitive type, wherein each instance of the triangle primitive type comprises three pixel positions forming a triangle, and the color components corresponding to each of the three pixel positions, and output the two instances of the triangle primitive type;
- using a built-in rasterization function of the GPU for rasterization of each instance of the triangle primitive type outputted by the geometry shaders of the GPU, such that all pixel positions of the texture each corresponds to a color component of the first color component, a color component of the second color and two color components of the third color;
- inputting each pixel position of the texture and the corresponding color components of each of the first, second and third color to a pixel shader of the GPU;
- and
- forming an image based on outputs of the pixel shader, wherein all pixels of the image have a color component from each of the first, second and third color.
A non-transitory computer-readable storage medium storing instructions that when executed by a device having processing capability perform a method of de-mosaicing an image captured by an image sensor comprising a color filter array, the method comprising:
- receiving, by a graphical processing unit, GPU, a texture corresponding to the captured image, the texture having a mosaic pattern with a first, second and third color, each pixel in the texture having a color component from only one color of said first, second and third color, wherein 25% of the pixels in the texture have a color component from the first color, wherein 25% of the pixels in the texture have a color component from the second color, wherein 50% of the pixels in the texture have a color component from the third color;
- defining four grids from the texture, each grid defining a plurality of pixel positions in the texture, wherein a first grid define pixel positions of all pixels of the texture having a color component from the first color, wherein a second grid define pixel positions of all pixels of the texture having a color component from the second color, wherein a third grid define pixel positions of 50% of the pixels of the texture having a color component from the third color, wherein a fourth grid define pixel positions of a remaining 50% of the pixels of the texture having a color component from the third color;
- initiating a vertex shader of the GPU for each grid and each pixel position in the grid, and providing as an input to the vertex shader the pixel position, wherein the vertex shader extracts the color component corresponding to the pixel position in the texture and outputs the pixel position and the corresponding color component of the pixel position;
- defining a plurality of instances of a patch primitive type for each grid and using the output from the vertex shaders, each instance of the patch primitive type comprising four pixel positions forming a quad, and the color component corresponding to each of the four pixel positions;
- initiating a geometry shader of the GPU for each instance of the patch primitive type, and providing as a input to the geometry shader the instance of the patch primitive type, wherein the geometry shader defines two instances of a triangle primitive type from the instance of the patch primitive type based on an order of the pixel positions comprised in the instance of the patch primitive type, wherein each instance of the triangle primitive type comprises three pixel positions forming a triangle, and the color components corresponding to each of the three pixel positions, and output the two instances of the triangle primitive type;
- using a built-in rasterization function of the GPU for rasterization of each instance of the triangle primitive type outputted by the geometry shaders of the GPU, such that all pixel positions of the texture each corresponds to a color component of the first color component, a color component of the second color and two color components of the third color;
- inputting each pixel position of the texture and the corresponding color components of each of the first, second and third color to a pixel shader of the GPU;
- and
- forming an image based on outputs of the pixel shader, wherein all pixels of the image have a color component from each of the first, second and third color.
A graphical processing unit, GPU, arranged for demosaicing an image captured by an image sensor comprising a color filter array, wherein the GPU is operable to:
- receive an texture corresponding to the captured image, the texture having a mosaic pattern with a first, second and third color, each pixel in the texture having a color component from only one color of said first, second and third color, wherein 25% of the pixels in the texture have a color component from the first color, wherein 25% of the pixels in the texture have a color component from the second color, wherein 50% of the pixels in the texture have a color component from the third color;
- from the texture, define four grids, each grid defining a plurality of pixel positions in the texture, wherein a first grid define pixel positions of all pixels of the texture having a color component from the first color, wherein a second grid define pixel positions of all pixels of the texture having a color component from the second color, wherein a third grid define pixel positions of 50% of the pixels of the texture having a color component from the third color, wherein a fourth grid define pixel positions of a remaining 50% of the pixels of the texture having a color component from the third color;
- for each grid and each pixel position in the grid, initiate a vertex shader and provide as a input to the vertex shader the pixel position, wherein the vertex shader extracts the color component corresponding to the pixel position in the texture and outputs the pixel position and the corresponding color component of the pixel position;
- for each grid and using the output from the vertex shaders, define a plurality of instances of a patch primitive type, each instance of the patch primitive type comprising four pixel positions forming a quad, and the color component corresponding to each of the four pixel positions;
- for each instance of the patch primitive type, initiate a geometry shader, and provide as a input to the geometry shader the instance of the patch primitive type, wherein the geometry shader defines two instances of a triangle primitive type from the instance of the patch primitive type based on an order of the pixel positions comprised in the instance of the patch primitive type, wherein each instance of the triangle primitive type comprises three pixel positions forming a triangle, and the color components corresponding to each of the three pixel positions, and outputs the two instances of the triangle primitive type;
- use a built-in rasterization function for rasterization of each instance of the triangle primitive type outputted by the geometry shaders, such that all pixel positions of the texture each corresponds to a color component of the first color, a color component of the second color and two color components of the third color;
- input each pixel position of the texture and the corresponding color components of each of the first, second and third color to a pixel shader;
- and
- form an image based on outputs of the pixel shader, wherein all pixels of the image have a color component from each of the first, second and third color.
Dependencies are inferred from the claim text.