Commit 095b0d32 authored by Mark Harfouche's avatar Mark Harfouche

Fix BayerXX2RGBA when blue is on the first line.

parent 796795ac
...@@ -923,8 +923,10 @@ static void Bayer2RGB_( const Mat& srcmat, Mat& dstmat, int code ) ...@@ -923,8 +923,10 @@ static void Bayer2RGB_( const Mat& srcmat, Mat& dstmat, int code )
{ {
int dst_step = (int)(dstmat.step/sizeof(T)); int dst_step = (int)(dstmat.step/sizeof(T));
Size size = srcmat.size(); Size size = srcmat.size();
int blue = code == CV_BayerBG2BGR || code == CV_BayerGB2BGR ? -1 : 1; int blue = (code == CV_BayerBG2BGR || code == CV_BayerGB2BGR ||
int start_with_green = code == CV_BayerGB2BGR || code == CV_BayerGR2BGR; code == CV_BayerBG2BGRA || code == CV_BayerGB2BGRA ) ? -1 : 1;
int start_with_green = (code == CV_BayerGB2BGR || code == CV_BayerGR2BGR ||
code == CV_BayerGB2BGRA || code == CV_BayerGR2BGRA);
int dcn = dstmat.channels(); int dcn = dstmat.channels();
size.height -= 2; size.height -= 2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment