Changeset 26451 for trunk/psLib/src/imageops/psImageBackground.c
- Timestamp:
- Dec 17, 2009, 9:31:52 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImageBackground.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImageBackground.c
r24481 r26451 15 15 #include "psRandom.h" 16 16 #include "psError.h" 17 18 static int nFailures = 0; 19 20 void psImageBackgroundInit() { 21 nFailures = 0; 22 return; 23 } 17 24 18 25 // XXX allow the user to choose the stats method? … … 91 98 } 92 99 if (n < 0.01*Nsubset) { 93 psLogMsg("psLib.psImageBackground", PS_LOG_DETAIL, 94 "Unable to measure image background: too few data points (%ld)", n); 100 if ((nFailures < 3) || (nFailures % 100 == 0)) { 101 psLogMsg("psLib.psImageBackground", PS_LOG_DETAIL, "Unable to measure image background: too few data points (%ld) (%d failures)", n, nFailures); 102 } 103 nFailures ++; 95 104 psFree(values); 96 105 return false; … … 108 117 109 118 if (!psVectorSort(values, values)) { 110 psError(PS_ERR_UNKNOWN, false, "Unable to sort values.\n"); 119 if ((nFailures < 3) || (nFailures % 100 == 0)) { 120 psError(PS_ERR_UNKNOWN, false, "Unable to sort values.(%d failures)\n", nFailures); 121 } 122 nFailures ++; 111 123 psFree(values); 112 124 return false; … … 132 144 fclose (f); 133 145 } 134 psError(PS_ERR_UNKNOWN, false, "Unable to measure statistics for image background " 135 "(%dx%d, (row0,col0) = (%d,%d)", 136 image->numRows, image->numCols, image->row0, image->col0); 146 if ((nFailures < 3) || (nFailures % 100 == 0)) { 147 psError(PS_ERR_UNKNOWN, false, "Unable to measure statistics for image background " 148 "(%dx%d, (row0,col0) = (%d,%d) (%d failures)\n", 149 image->numRows, image->numCols, image->row0, image->col0, nFailures); 150 } 151 nFailures ++; 137 152 psFree(values); 138 153 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
