A demosaicing (also de-mosaicing, demosaicking or debayering) algorithm is a digital image process used to reconstruct a full color image from the incomplete color samples output from an image sensor overlaid with a color filter array (CFA). It is also known as CFA interpolation or color reconstruction.
Questions tagged [demosaicing]
24 questions
3
votes
0 answers
SSE2 convert packed RGB to RGBA pixels (add a 4th 0xFF byte after every 3 bytes)
My application is processing a computationally heavy near realtime workload which I need to speed up as much as possible. The software is written in C++ and only targeting Linux.
My program grabs a 6.4 megapixel RAW data buffer off a specialist…

Amanda
- 321
- 2
- 12
3
votes
2 answers
How to demosaic a bayer RAW image?
I have a proprietary bayer RAW image which I need to demosaic on Android to display the image. I am reading the file header byte by byte to retrieve the resolution info (imageWidth/imageHeight). After the header there is the pixel data from byte…

Reto
- 1,660
- 3
- 19
- 31
3
votes
0 answers
Python script to DEMOSAIC a RCCB raw image
I need a Python script to DEMOSAIC a RCCB raw image . I've attached a sample image as well.
any suggestions ? Thanks much . I hope I didn't create any obsolete question. I could understand the concept here , but not sure how do demosaic in python…

Raj Josyula
- 140
- 1
- 12
3
votes
0 answers
RAW Bayer demosaic directly to YUV without going through RGB
I'm looking to demosaic RAW bayer images straight to YUV format and time is crucial. Online algorithms I found go through RAW->RGB and then RGB->YUV. is there a direct way? A c++/python/Pseudo code would be highly appreciated, Thanks!

Daniel Schuldenfrei
- 31
- 2
2
votes
2 answers
Bayer filter, bayer demosaicing OpenCV C++
I have some troubles with bayer-demosaicing (OpenCV C++).
I need to convert the image from the Bayer mosaic to the normal version.
I tried to use the cv::cvtColor with cv::COLOR_BayerGB2BGR, but the output image looks so "green" , and I don't…

Mikhail K
- 21
- 2
2
votes
0 answers
Demosaicing an RCCB color filter array
I am looking for techniques that allow me to demosaic an RCCB CFA.
I came across this paper on SPIE "Color image acquisition method using color filter arrays occupying overlapped color spaces" that gives a good technique to convert to interpolate…

Dinesh Iyer
- 681
- 3
- 11
1
vote
1 answer
Convert RAW-image in Bayer-encoding (RGGB) and 16 bit depth to RGB: Final image is too dark and has a greenish cast (Rust)
I use a Rust library to parse raw ARW images (Sony Raw Format). I get a raw buffer of 16 bit pixels, it gives me the CFA (Color Filter Array) (which is RGGB), and the data buffer contains height * width pixels in bayer encoding. Each pixel is stored…

phip1611
- 5,460
- 4
- 30
- 57
1
vote
1 answer
Demosaicing/Coloring a bayer bggr image with openCV
I am working with a custom USB camera which sends raw Bayer BGGR 16 bit/pixel images. I have a C++ project which is able to show the camera stream in grayscale, but when I try to use any of the OpenCV's built in color conversion function I always…

LB91
- 21
- 6
1
vote
1 answer
How to create raw synthethic images
I want to perform the color calibration of my camera. That's why I search demosaic algorithm, which can provide the closest color to color of a real object. That's why I want:
create synthetic images in OpenCV with known colors
mosaic it
pass it in…

MegaMan
- 59
- 5
1
vote
1 answer
How to convert a numerical data array into RAW image data in Swift?
I have a data array of Int16 or Int32 numerical values that are the raw image data from a 11MP camera chip with an RGGB pixel layout (CFA). The data are exported by the camera driver as FITS data, which is basically a vector or long string of bytes…

Planetoid30
- 21
- 3
1
vote
2 answers
Reading little endian file 8 bits at a time and performing binary operations on it
I want to read 8 bits at a time from a file in little endian format, I think my cpu is also little endian so I need not to worry about the endianess, right?
what I am reading are numbers, intensity values of RGGB CFA from a RAW12 file.
Here is my…

ksraj
- 13
- 2
1
vote
1 answer
Flatten a 3D array to a 2D array using a second matrix to choose elements in third dimension
I have two input arrays: data_arr of dimensions (i,j,k) and index_arr of dimensions(i,j). The entries in index_arr are integers in the range [0, k-1]. I would like to create an output array (output_arr) of dimensions (i,j) where for each element of…

Spoonless
- 561
- 5
- 14
1
vote
1 answer
'numpy.ndarray' object is not callable?
Running this script:
import time
import picamera
import picamera.array
import numpy as np
with picamera.PiCamera() as camera:
with picamera.array.PiBayerArray(camera) as stream:
camera.capture(stream, 'jpeg', bayer=True)
#…

Mayke Santos
- 67
- 8
1
vote
1 answer
What interpolation methods used in cv::cvtColor() demosaicing
I would like to reproduce the cv::cvtColor() function that converts a raw Bayer image into an RGB image. There are several different ways like COLOR_BayerBG2BGR, or COLOR_BayerBG2BGR_VNG, and COLOR_BayerBG2BGR_EA. However, I can not find any…

Nazar
- 820
- 5
- 13
- 36
1
vote
0 answers
How to demosaic a picamera raw image with rawpy?
I am attempting to stack long exposures from a Pi NoIR camera.
The picamera raw format can be unpacked into a numpy array based on the example: http://picamera.readthedocs.io/en/release-1.10/recipes2.html#raw-bayer-data-captures
How can this numpy…

Ian
- 21
- 4