}
}
-
struct RGB2Lab_b
{
typedef uchar channel_type;
const float* _whitept, bool _srgb)
: srccn(_srccn), srgb(_srgb)
{
+ static volatile int _3 = 3;
initLabTabs();
if(!_coeffs) _coeffs = sRGB2XYZ_D65;
(1 << lab_shift)/_whitept[2]
};
- for( int i = 0; i < 3; i++ )
+ for( int i = 0; i < _3; i++ )
{
coeffs[i*3+(blueIdx^2)] = cvRound(_coeffs[i*3]*scale[i]);
coeffs[i*3+1] = cvRound(_coeffs[i*3+1]*scale[i]);
coeffs[i*3+blueIdx] = cvRound(_coeffs[i*3+2]*scale[i]);
+
CV_Assert( coeffs[i] >= 0 && coeffs[i*3+1] >= 0 && coeffs[i*3+2] >= 0 &&
coeffs[i*3] + coeffs[i*3+1] + coeffs[i*3+2] < 2*(1 << lab_shift) );
}
const float* _whitept, bool _srgb)
: srccn(_srccn), srgb(_srgb)
{
+ volatile int _3 = 3;
initLabTabs();
if(!_coeffs) _coeffs = sRGB2XYZ_D65;
if(!_whitept) _whitept = D65;
float scale[] = { LabCbrtTabScale/_whitept[0], LabCbrtTabScale, LabCbrtTabScale/_whitept[2] };
- for( int i = 0; i < 3; i++ )
+ for( int i = 0; i < _3; i++ )
{
coeffs[i*3+(blueIdx^2)] = _coeffs[i*3]*scale[i];
coeffs[i*3+1] = _coeffs[i*3+1]*scale[i];
for( int i = 0; i < 3; i++ )
{
- coeffs[i*3+(blueIdx^2)] = _coeffs[i*3];
+ coeffs[i*3] = _coeffs[i*3];
coeffs[i*3+1] = _coeffs[i*3+1];
- coeffs[i*3+blueIdx] = _coeffs[i*3+2];
+ coeffs[i*3+2] = _coeffs[i*3+2];
+ if( blueIdx == 0 )
+ std::swap(coeffs[i*3], coeffs[i*3+2]);
CV_Assert( coeffs[i*3] >= 0 && coeffs[i*3+1] >= 0 && coeffs[i*3+2] >= 0 &&
coeffs[i*3] + coeffs[i*3+1] + coeffs[i*3+2] < 1.5f );
}
int scn = src.channels(), depth = src.depth(), bidx;
CV_Assert( depth == CV_8U || depth == CV_16U || depth == CV_32F );
-
+
switch( code )
{
case CV_BGR2BGRA: case CV_RGB2BGRA: case CV_BGRA2BGR:
"cascade-detector", //ticket 432
"chessboard-detector", //ticket 569
"chessboard-subpixel", //ticket 473
- "color-luv", //ticket 502
+ //"color-luv", //ticket 502
"descriptor_sift", //ticket 567
"descriptor_surf", //ticket 568
"warp-remap", //ticket 576
"warp-resize", //ticket 429
"warp-undistort", //ticket 577
- "color-lab", //ticket 627
+ //"color-lab", //ticket 627
0
};