Commit 70bb857c authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge remote-tracking branch 'origin/master'

parents ff90c3eb d525362c
...@@ -382,12 +382,11 @@ bool JpegDecoder::readData( Mat& img ) ...@@ -382,12 +382,11 @@ bool JpegDecoder::readData( Mat& img )
bool result = false; bool result = false;
int step = (int)img.step; int step = (int)img.step;
bool color = img.channels() > 1; 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; jpeg_decompress_struct* cinfo = &((JpegState*)m_state)->cinfo;
JpegErrorMgr* jerr = &state->jerr; JpegErrorMgr* jerr = &((JpegState*)m_state)->jerr;
JSAMPARRAY buffer = 0; JSAMPARRAY buffer = 0;
if( setjmp( jerr->setjmp_buffer ) == 0 ) if( setjmp( jerr->setjmp_buffer ) == 0 )
......
...@@ -96,8 +96,8 @@ cvMeanShift( const void* imgProb, CvRect windowIn, ...@@ -96,8 +96,8 @@ cvMeanShift( const void* imgProb, CvRect windowIn,
} }
cur_rect.width = MAX(cur_rect.width, 1); cur_rect.width = MAX(cur_rect.width, 1);
cur_rect.height = MAX(cur_rect.height, 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 ); cvMoments( &cur_win, &moments );
/* Calculating center of mass */ /* Calculating center of mass */
...@@ -240,7 +240,7 @@ cvCamShift( const void* imgProb, CvRect windowIn, ...@@ -240,7 +240,7 @@ cvCamShift( const void* imgProb, CvRect windowIn,
if( length < width ) if( length < width )
{ {
double t; double t;
CV_SWAP( length, width, t ); CV_SWAP( length, width, t );
CV_SWAP( cs, sn, t ); CV_SWAP( cs, sn, t );
theta = CV_PI*0.5 - theta; theta = CV_PI*0.5 - theta;
...@@ -275,7 +275,7 @@ cvCamShift( const void* imgProb, CvRect windowIn, ...@@ -275,7 +275,7 @@ cvCamShift( const void* imgProb, CvRect windowIn,
if( _comp ) if( _comp )
*_comp = comp; *_comp = comp;
if( box ) if( box )
{ {
box->size.height = (float)length; box->size.height = (float)length;
...@@ -300,6 +300,10 @@ cv::RotatedRect cv::CamShift( InputArray _probImage, Rect& window, ...@@ -300,6 +300,10 @@ cv::RotatedRect cv::CamShift( InputArray _probImage, Rect& window,
{ {
CvConnectedComp comp; CvConnectedComp comp;
CvBox2D box; 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(); Mat probImage = _probImage.getMat();
CvMat c_probImage = probImage; CvMat c_probImage = probImage;
cvCamShift(&c_probImage, window, (CvTermCriteria)criteria, &comp, &box); cvCamShift(&c_probImage, window, (CvTermCriteria)criteria, &comp, &box);
......
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