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 information on what interpolation method each of those approaches uses. There should be some references to publications or patents. Anyone knows?
Asked
Active
Viewed 2,021 times
1

Nazar
- 820
- 5
- 13
- 36
1 Answers
-2
OpenCV, as the name already suggests, is open source. Just read the source code if you are interested in what is happening under the hood. Or copy it if you want to "reproduce" the function...
https://github.com/opencv/opencv
Usually its just the average of the neighbouring values. what fancy interpolation method would you expect?

Piglet
- 27,501
- 3
- 20
- 43
-
Actually, it seems to work pretty good as for a simple linear interpolation, so I did expect some fancy interpolation and possibly some after-processing. How do I find the source code? – Nazar Dec 08 '16 at 20:35
-
1@Naz you find the source code in the repository on GitHub which I provided a link to. Then you use the search function to find what you need. https://github.com/opencv/opencv/blob/4fd00c1ae1968115670d631121363f7dbaa71922/modules/imgproc/src/color.cpp#L9694 – Piglet Dec 08 '16 at 20:48