bool result = false;
int step = (int)img.step;
bool color = img.channels() > 1;
- JpegState* state = (JpegState*)m_state;
- if( state && m_width && m_height )
+ if( m_state && m_width && m_height )
{
- jpeg_decompress_struct* cinfo = &state->cinfo;
- JpegErrorMgr* jerr = &state->jerr;
+ jpeg_decompress_struct* cinfo = &((JpegState*)m_state)->cinfo;
+ JpegErrorMgr* jerr = &((JpegState*)m_state)->jerr;
JSAMPARRAY buffer = 0;
if( setjmp( jerr->setjmp_buffer ) == 0 )
}
cur_rect.width = MAX(cur_rect.width, 1);
cur_rect.height = MAX(cur_rect.height, 1);
-
- cvGetSubRect( mat, &cur_win, cur_rect );
+
+ cvGetSubRect( mat, &cur_win, cur_rect );
cvMoments( &cur_win, &moments );
/* Calculating center of mass */
if( length < width )
{
double t;
-
+
CV_SWAP( length, width, t );
CV_SWAP( cs, sn, t );
theta = CV_PI*0.5 - theta;
if( _comp )
*_comp = comp;
-
+
if( box )
{
box->size.height = (float)length;
{
CvConnectedComp comp;
CvBox2D box;
+
+ box.center.x = box.center.y = 0; box.angle = 0; box.size.width = box.size.height = 0;
+ comp.rect.x = comp.rect.y = comp.rect.width = comp.rect.height = 0;
+
Mat probImage = _probImage.getMat();
CvMat c_probImage = probImage;
cvCamShift(&c_probImage, window, (CvTermCriteria)criteria, &comp, &box);