Home | History | Annotate | Download | only in src

Lines Matching full:state

57     CvStereoBMState* state = 0;
63 state = (CvStereoBMState*)cvAlloc( sizeof(*state) );
64 if( !state )
67 state->preFilterType = CV_STEREO_BM_NORMALIZED_RESPONSE;
68 state->preFilterSize = 9;
69 state->preFilterCap = 31;
70 state->SADWindowSize = 15;
71 state->minDisparity = 0;
72 state->numberOfDisparities = numberOfDisparities > 0 ? numberOfDisparities : 64;
73 state->textureThreshold = 10;
74 state->uniquenessRatio = 15;
75 state->speckleRange = state->speckleWindowSize = 0;
77 state->preFilteredImg0 = state->preFilteredImg1 = state->slidingSumBuf = 0;
82 cvReleaseStereoBMState( &state );
83 return state;
88 cvReleaseStereoBMState( CvStereoBMState** state )
94 if( !state )
97 if( !*state )
100 cvReleaseMat( &(*state)->preFilteredImg0 );
101 cvReleaseMat( &(*state)->preFilteredImg1 );
102 cvReleaseMat( &(*state)->slidingSumBuf );
103 cvFree( state );
178 CvMat* disp, CvStereoBMState* state,
182 int wsz = state->SADWindowSize, wsz2 = wsz/2;
184 int ndisp = state->numberOfDisparities;
185 int mindisp = state->minDisparity;
190 int ftzero = state->preFilterCap;
191 int textureThreshold = state->textureThreshold;
192 int uniquenessRatio = state->uniquenessRatio;
386 CvMat* disp, CvStereoBMState* state,
390 int wsz = state->SADWindowSize, wsz2 = wsz/2;
392 int ndisp = state->numberOfDisparities;
393 int mindisp = state->minDisparity;
398 int ftzero = state->preFilterCap;
399 int textureThreshold = state->textureThreshold;
400 int uniquenessRatio = state->uniquenessRatio;
549 CvArr* disparr, CvStereoBMState* state )
573 if( !state )
574 CV_ERROR( CV_StsNullPtr, "Stereo BM state is NULL." );
576 if( state->preFilterType != CV_STEREO_BM_NORMALIZED_RESPONSE )
579 if( state->preFilterSize < 5 || state->preFilterSize > 255 || state->preFilterSize % 2 == 0 )
582 if( state->preFilterCap < 1 || state->preFilterCap > 63 )
585 if( state->SADWindowSize < 5 || state->SADWindowSize > 255 || state->SADWindowSize % 2 == 0 ||
586 state->SADWindowSize >= MIN(left0->cols, left0->rows) )
590 if( state->numberOfDisparities <= 0 || state->numberOfDisparities % 16 != 0 )
592 if( state->textureThreshold < 0 )
594 if( state->uniquenessRatio < 0 )
597 if( !state->preFilteredImg0 ||
598 state->preFilteredImg0->cols*state->preFilteredImg0->rows < left0->cols*left0->rows )
600 cvReleaseMat( &state->preFilteredImg0 );
601 cvReleaseMat( &state->preFilteredImg1 );
603 state->preFilteredImg0 = cvCreateMat( left0->rows, left0->cols, CV_8U );
604 state->preFilteredImg1 = cvCreateMat( left0->rows, left0->cols, CV_8U );
606 left = cvMat(left0->rows, left0->cols, CV_8U, state->preFilteredImg0->data.ptr);
607 right = cvMat(right0->rows, right0->cols, CV_8U, state->preFilteredImg1->data.ptr);
609 mindisp = state->minDisparity;
610 ndisp = state->numberOfDisparities;
619 int FILTERED = (short)((state->minDisparity - 1) << DISPARITY_SHIFT);
624 wsz = state->SADWindowSize;
627 bufSize1 = (width + state->preFilterSize + 2)*sizeof(int) + 256;
631 if( !state->slidingSumBuf || state->slidingSumBuf->cols < bufSize*n )
633 cvReleaseMat( &state->slidingSumBuf );
634 state->slidingSumBuf = cvCreateMat( 1, bufSize*n, CV_8U );
644 icvPrefilter( left0, &left, state->preFilterSize,
645 state->preFilterCap, state->slidingSumBuf->data.ptr );
649 icvPrefilter( right0, &right, state->preFilterSize,
650 state->preFilterCap, state->slidingSumBuf->data.ptr + bufSize1*(n>1) );
665 if( state->preFilterCap <= 31 && state->SADWindowSize <= 21 )
667 icvFindStereoCorrespondenceBM_SSE2( &left_i, &right_i, &disp_i, state,
668 state->slidingSumBuf->data.ptr + thread_id*bufSize0, row0, left.rows-row1 );
673 icvFindStereoCorrespondenceBM( &left_i, &right_i, &disp_i, state,
674 state->slidingSumBuf->data.ptr + thread_id*bufSize0, row0, left.rows-row1 );