1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Fixed range for 'v' channel for 8U images

This commit is contained in:
Alexander Karsakov
2014-08-20 15:07:19 +04:00
parent de2a8d3706
commit 3d222d313b
5 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -2090,7 +2090,7 @@ struct RGB2Luv_b
{
dst[j] = saturate_cast<uchar>(buf[j]*2.55f);
dst[j+1] = saturate_cast<uchar>(buf[j+1]*0.72033898305084743f + 96.525423728813564f);
dst[j+2] = saturate_cast<uchar>(buf[j+2]*0.99609375f + 139.453125f);
dst[j+2] = saturate_cast<uchar>(buf[j+2]*0.9732824427480916f + 136.259541984732824f);
}
}
}
@@ -2122,7 +2122,7 @@ struct Luv2RGB_b
{
buf[j] = src[j]*(100.f/255.f);
buf[j+1] = (float)(src[j+1]*1.388235294117647f - 134.f);
buf[j+2] = (float)(src[j+2]*1.003921568627451f - 140.f);
buf[j+2] = (float)(src[j+2]*1.027450980392157f - 140.f);
}
cvt(buf, buf, dn);
+2 -2
View File
@@ -1747,7 +1747,7 @@ __kernel void BGR2Luv(__global const uchar * src, int src_step, int src_offset,
dst[0] = SAT_CAST(L * 2.55f);
dst[1] = SAT_CAST(fma(u, 0.72033898305084743f, 96.525423728813564f));
dst[2] = SAT_CAST(fma(v, 0.99609375f, 139.453125f));
dst[2] = SAT_CAST(fma(v, 0.9732824427480916f, 136.259541984732824f));
++y;
dst += dst_step;
@@ -1843,7 +1843,7 @@ __kernel void Luv2BGR(__global const uchar * src, int src_step, int src_offset,
float d, X, Y, Z;
float L = src[0]*(100.f/255.f);
float u = fma(convert_float(src[1]), 1.388235294117647f, -134.f);
float v = fma(convert_float(src[2]), 1.003921568627451f, - 140.f);
float v = fma(convert_float(src[2]), 1.027450980392157f, - 140.f);
Y = (L + 16.f) * (1.f/116.f);
Y = Y*Y*Y;
d = (1.f/13.f)/L;