• Home
  • Raw
  • Download

Lines Matching refs:hist

47     CvHistogram *hist = 0;  in cvCreateHist()  local
58 CV_CALL( hist = (CvHistogram *)cvAlloc( sizeof( CvHistogram ))); in cvCreateHist()
60 hist->type = CV_HIST_MAGIC_VAL; in cvCreateHist()
61 hist->thresh2 = 0; in cvCreateHist()
62 hist->bins = 0; in cvCreateHist()
65 CV_CALL( hist->bins = cvInitMatNDHeader( &hist->mat, dims, sizes, in cvCreateHist()
67 CV_CALL( cvCreateData( hist->bins )); in cvCreateHist()
71 CV_CALL( hist->bins = cvCreateSparseMat( dims, sizes, CV_HIST_DEFAULT_TYPE )); in cvCreateHist()
79 CV_CALL( cvSetHistBinRanges( hist, ranges, uniform )); in cvCreateHist()
84 cvReleaseHist( &hist ); in cvCreateHist()
86 return hist; in cvCreateHist()
92 cvMakeHistHeaderForArray( int dims, int *sizes, CvHistogram *hist, in cvMakeHistHeaderForArray() argument
101 if( !hist ) in cvMakeHistHeaderForArray()
107 hist->thresh2 = 0; in cvMakeHistHeaderForArray()
108 hist->type = CV_HIST_MAGIC_VAL; in cvMakeHistHeaderForArray()
109 CV_CALL( hist->bins = cvInitMatNDHeader( &hist->mat, dims, sizes, in cvMakeHistHeaderForArray()
117 CV_CALL( cvSetHistBinRanges( hist, ranges, uniform )); in cvMakeHistHeaderForArray()
120 result = hist; in cvMakeHistHeaderForArray()
124 if( cvGetErrStatus() < 0 && hist ) in cvMakeHistHeaderForArray()
126 hist->type = 0; in cvMakeHistHeaderForArray()
127 hist->bins = 0; in cvMakeHistHeaderForArray()
135 cvReleaseHist( CvHistogram **hist ) in cvReleaseHist() argument
141 if( !hist ) in cvReleaseHist()
144 if( *hist ) in cvReleaseHist()
146 CvHistogram* temp = *hist; in cvReleaseHist()
151 *hist = 0; in cvReleaseHist()
171 cvClearHist( CvHistogram *hist ) in cvClearHist() argument
177 if( !CV_IS_HIST(hist) ) in cvClearHist()
180 cvZero( hist->bins ); in cvClearHist()
188 cvThreshHist( CvHistogram* hist, double thresh ) in cvThreshHist() argument
194 if( !CV_IS_HIST(hist) ) in cvThreshHist()
197 if( !CV_IS_SPARSE_MAT(hist->bins) ) in cvThreshHist()
200 CV_CALL( cvGetMat( hist->bins, &mat, 0, 1 )); in cvThreshHist()
205 CvSparseMat* mat = (CvSparseMat*)hist->bins; in cvThreshHist()
224 cvNormalizeHist( CvHistogram* hist, double factor ) in cvNormalizeHist() argument
231 if( !CV_IS_HIST(hist) ) in cvNormalizeHist()
234 if( !CV_IS_SPARSE_HIST(hist) ) in cvNormalizeHist()
237 CV_CALL( cvGetMat( hist->bins, &mat, 0, 1 )); in cvNormalizeHist()
245 CvSparseMat* mat = (CvSparseMat*)hist->bins; in cvNormalizeHist()
273 cvGetMinMaxHistValue( const CvHistogram* hist, in cvGetMinMaxHistValue() argument
285 if( !CV_IS_HIST(hist) ) in cvGetMinMaxHistValue()
288 dims = cvGetDims( hist->bins, size ); in cvGetMinMaxHistValue()
290 if( !CV_IS_SPARSE_HIST(hist) ) in cvGetMinMaxHistValue()
295 CV_CALL( cvGetMat( hist->bins, &mat, 0, 1 )); in cvGetMinMaxHistValue()
338 CvSparseMat* mat = (CvSparseMat*)hist->bins; in cvGetMinMaxHistValue()
721 cvSetHistBinRanges( CvHistogram* hist, float** ranges, int uniform ) in cvSetHistBinRanges() argument
733 if( !CV_IS_HIST(hist) ) in cvSetHistBinRanges()
736 CV_CALL( dims = cvGetDims( hist->bins, size )); in cvSetHistBinRanges()
746 hist->thresh[i][0] = ranges[i][0]; in cvSetHistBinRanges()
747 hist->thresh[i][1] = ranges[i][1]; in cvSetHistBinRanges()
750 hist->type |= CV_HIST_UNIFORM_FLAG + CV_HIST_RANGES_FLAG; in cvSetHistBinRanges()
756 if( !hist->thresh2 ) in cvSetHistBinRanges()
758 CV_CALL( hist->thresh2 = (float**)cvAlloc( in cvSetHistBinRanges()
759 dims*sizeof(hist->thresh2[0])+ in cvSetHistBinRanges()
760 total*sizeof(hist->thresh2[0][0]))); in cvSetHistBinRanges()
762 dim_ranges = (float*)(hist->thresh2 + dims); in cvSetHistBinRanges()
779 hist->thresh2[i] = dim_ranges; in cvSetHistBinRanges()
783 hist->type |= CV_HIST_RANGES_FLAG; in cvSetHistBinRanges()
784 hist->type &= ~CV_HIST_UNIFORM_FLAG; in cvSetHistBinRanges()
794 icvCalcHistLookupTables8u( const CvHistogram* hist, int dims, int* size, int* tab ) in icvCalcHistLookupTables8u() argument
797 int is_sparse = CV_IS_SPARSE_HIST( hist ); in icvCalcHistLookupTables8u()
798 int have_range = CV_HIST_HAS_RANGES(hist); in icvCalcHistLookupTables8u()
801 if( !have_range || CV_IS_UNIFORM_HIST(hist)) in icvCalcHistLookupTables8u()
805 double a = have_range ? hist->thresh[i][0] : 0; in icvCalcHistLookupTables8u()
806 double b = have_range ? hist->thresh[i][1] : 256; in icvCalcHistLookupTables8u()
812 step = ((CvMatND*)(hist->bins))->dim[i].step/sizeof(float); in icvCalcHistLookupTables8u()
830 double limit = hist->thresh2[i][0]; in icvCalcHistLookupTables8u()
835 step = ((CvMatND*)(hist->bins))->dim[i].step/sizeof(float); in icvCalcHistLookupTables8u()
848 limit = hist->thresh2[i][idx+1]; in icvCalcHistLookupTables8u()
872 CvSize size, CvHistogram* hist ) in icvCalcHist_8u_C1R() argument
875 int is_sparse = CV_IS_SPARSE_HIST(hist); in icvCalcHist_8u_C1R()
880 dims = cvGetDims( hist->bins, histsize ); in icvCalcHist_8u_C1R()
883 status = icvCalcHistLookupTables8u( hist, dims, histsize, tab ); in icvCalcHist_8u_C1R()
891 int* bins = ((CvMatND*)(hist->bins))->data.i; in icvCalcHist_8u_C1R()
1067 CvSparseMat* mat = (CvSparseMat*)(hist->bins); in icvCalcHist_8u_C1R()
1125 CvSize size, CvHistogram* hist ) in icvCalcHist_32f_C1R() argument
1127 int is_sparse = CV_IS_SPARSE_HIST(hist); in icvCalcHist_32f_C1R()
1128 int uniform = CV_IS_UNIFORM_HIST(hist); in icvCalcHist_32f_C1R()
1133 dims = cvGetDims( hist->bins, histsize ); in icvCalcHist_32f_C1R()
1140 double t = histsize[i]/((double)hist->thresh[i][1] - hist->thresh[i][0]); in icvCalcHist_32f_C1R()
1142 uni_range[i][1] = -t*hist->thresh[i][0]; in icvCalcHist_32f_C1R()
1148 CvMatND* mat = (CvMatND*)(hist->bins); in icvCalcHist_32f_C1R()
1211 int step0 = ((CvMatND*)(hist->bins))->dim[0].step/sizeof(float); in icvCalcHist_32f_C1R()
1308 float* thresh = hist->thresh2[i]; in icvCalcHist_32f_C1R()
1333 CvSparseMat* mat = (CvSparseMat*)(hist->bins); in icvCalcHist_32f_C1R()
1369 float* thresh = hist->thresh2[i]; in icvCalcHist_32f_C1R()
1402 cvCalcArrHist( CvArr** img, CvHistogram* hist, in cvCalcArrHist() argument
1418 if( !CV_IS_HIST(hist)) in cvCalcArrHist()
1424 CV_CALL( dims = cvGetDims( hist->bins )); in cvCalcArrHist()
1479 if( !CV_IS_SPARSE_HIST(hist)) in cvCalcArrHist()
1481 dense = *(CvMatND*)hist->bins; in cvCalcArrHist()
1487 CV_CALL( cvZero( hist->bins )); in cvCalcArrHist()
1489 else if( !CV_IS_SPARSE_HIST(hist)) in cvCalcArrHist()
1491 CV_CALL( cvConvert( (CvMatND*)hist->bins, &dense )); in cvCalcArrHist()
1495 CvSparseMat* mat = (CvSparseMat*)(hist->bins); in cvCalcArrHist()
1507 if( CV_MAT_DEPTH(mat0->type) > CV_8S && !CV_HIST_HAS_RANGES(hist)) in cvCalcArrHist()
1514 IPPI_CALL( icvCalcHist_8u_C1R( ptr, step, maskptr, maskstep, size, hist )); in cvCalcArrHist()
1520 IPPI_CALL( icvCalcHist_32f_C1R( v.fl, step, maskptr, maskstep, size, hist )); in cvCalcArrHist()
1527 if( !CV_IS_SPARSE_HIST(hist)) in cvCalcArrHist()
1529 CV_CALL( cvConvert( &dense, (CvMatND*)hist->bins )); in cvCalcArrHist()
1533 CvSparseMat* mat = (CvSparseMat*)(hist->bins); in cvCalcArrHist()
1554 CvSize size, const CvHistogram* hist ) in icvCalcBackProject_8u_C1R() argument
1558 int is_sparse = CV_IS_SPARSE_HIST(hist); in icvCalcBackProject_8u_C1R()
1563 dims = cvGetDims( hist->bins, histsize ); in icvCalcBackProject_8u_C1R()
1566 status = icvCalcHistLookupTables8u( hist, dims, histsize, tab ); in icvCalcBackProject_8u_C1R()
1573 CvMatND* mat = (CvMatND*)(hist->bins); in icvCalcBackProject_8u_C1R()
1778 CvSparseMat* mat = (CvSparseMat*)(hist->bins); in icvCalcBackProject_8u_C1R()
1816 CvSize size, const CvHistogram* hist ) in icvCalcBackProject_32f_C1R() argument
1818 int is_sparse = CV_IS_SPARSE_HIST(hist); in icvCalcBackProject_32f_C1R()
1819 int uniform = CV_IS_UNIFORM_HIST(hist); in icvCalcBackProject_32f_C1R()
1824 dims = cvGetDims( hist->bins, histsize ); in icvCalcBackProject_32f_C1R()
1833 ((double)hist->thresh[i][1] - hist->thresh[i][0]); in icvCalcBackProject_32f_C1R()
1835 uni_range[i][1] = -t*hist->thresh[i][0]; in icvCalcBackProject_32f_C1R()
1841 CvMatND* mat = (CvMatND*)(hist->bins); in icvCalcBackProject_32f_C1R()
1903 int step0 = ((CvMatND*)(hist->bins))->dim[0].step/sizeof(float); in icvCalcBackProject_32f_C1R()
1960 float* thresh = hist->thresh2[i]; in icvCalcBackProject_32f_C1R()
1984 CvSparseMat* mat = (CvSparseMat*)(hist->bins); in icvCalcBackProject_32f_C1R()
2017 float* thresh = hist->thresh2[i]; in icvCalcBackProject_32f_C1R()
2048 cvCalcArrBackProject( CvArr** img, CvArr* dst, const CvHistogram* hist ) in cvCalcArrBackProject() argument
2062 if( !CV_IS_HIST(hist)) in cvCalcArrBackProject()
2068 CV_CALL( dims = cvGetDims( hist->bins )); in cvCalcArrBackProject()
2113 if( CV_MAT_DEPTH(mat0->type) > CV_8S && !CV_HIST_HAS_RANGES(hist)) in cvCalcArrBackProject()
2120 IPPI_CALL( icvCalcBackProject_8u_C1R( ptr, step, dstptr, dststep, size, hist )); in cvCalcArrBackProject()
2127 (float*)dstptr, dststep, size, hist )); in cvCalcArrBackProject()
2141 cvCalcArrBackProjectPatch( CvArr** arr, CvArr* dst, CvSize patch_size, CvHistogram* hist, in cvCalcArrBackProjectPatch() argument
2157 if( !CV_IS_HIST(hist)) in cvCalcArrBackProjectPatch()
2170 CV_CALL( dims = cvGetDims( hist->bins )); in cvCalcArrBackProjectPatch()
2171 CV_CALL( cvCopyHist( hist, &model )); in cvCalcArrBackProjectPatch()
2172 CV_CALL( cvNormalizeHist( hist, norm_factor )); in cvCalcArrBackProjectPatch()
2209 CV_CALL( result = cvCompareHist( model, hist, method )); in cvCalcArrBackProjectPatch()
2261 cvCalcProbDensity( const CvHistogram* hist, const CvHistogram* hist_mask, in cvCalcProbDensity() argument
2271 if( !CV_IS_HIST(hist) || !CV_IS_HIST(hist_mask) || !CV_IS_HIST(hist_dens) ) in cvCalcProbDensity()
2275 CvArr* arrs[] = { hist->bins, hist_mask->bins, hist_dens->bins }; in cvCalcProbDensity()
2313 CvHistogram* hist = 0; in cvEqualizeHist() local
2331 CV_CALL( hist = cvCreateHist( 1, &hist_sz, CV_HIST_ARRAY )); in cvEqualizeHist()
2333 CV_CALL( cvCalcArrHist( (CvArr**)&src, hist )); in cvEqualizeHist()
2336 h = (float*)cvPtr1D( hist->bins, 0 ); in cvEqualizeHist()
2349 cvReleaseHist(&hist); in cvEqualizeHist()
2461 const CvHistogram * hist = (const CvHistogram *) struct_ptr; in icvWriteHist() local
2472 is_uniform = (CV_IS_UNIFORM_HIST(hist) ? 1 : 0); in icvWriteHist()
2473 have_ranges = (hist->type & CV_HIST_RANGES_FLAG ? 1 : 0); in icvWriteHist()
2477 if(CV_IS_UNIFORM_HIST(hist)){ in icvWriteHist()
2478 cvWrite( fs, "mat", &(hist->mat) ); in icvWriteHist()
2480 else if(CV_IS_SPARSE_HIST(hist)){ in icvWriteHist()
2481 cvWrite( fs, "bins", hist->bins ); in icvWriteHist()
2489 dims = cvGetDims( hist->bins, sizes ); in icvWriteHist()
2493 cvWriteRawData( fs, hist->thresh[i], 2, "f" ); in icvWriteHist()
2498 cvWriteRawData( fs, hist->thresh2[i], sizes[i]+1, "f" ); in icvWriteHist()