Changeset 3088
- Timestamp:
- Jan 24, 2005, 4:42:27 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/pmObjects.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/pmObjects.c
r3086 r3088 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-01-25 0 1:22:12$7 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-01-25 02:42:27 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 104 104 psU32 col = 0; 105 105 psU32 row = 0; 106 psVector *rowX = NULL; 107 108 tmpRow = p_psGetRowVectorFromImage((psImage *) image, 0);106 107 row = 0; 108 tmpRow = p_psGetRowVectorFromImage((psImage *) image, row); 109 109 psVector *row1 = pmFindVectorPeeks(tmpRow, threshold); 110 tmpRow = p_psGetRowVectorFromImage((psImage *) image, 1);111 psVector *row2 = pmFindVectorPeeks(tmpRow, threshold);112 tmpRow = p_psGetRowVectorFromImage((psImage *) image, 2);113 psVector *row3 = pmFindVectorPeeks(tmpRow, threshold);114 115 row = 0;116 110 for (psU32 i = 0 ; i < row1->n ; i++ ) { 117 111 col = row1->data.U32[i]; 118 112 if (col == 0) { 119 if ( (image->data.F32[row][col] > image->data.F32[row][col+1]) &&120 (image->data.F32[row][col] > image->data.F32[row+1][col]) &&113 if ( (image->data.F32[row][col] > image->data.F32[row][col+1]) && 114 (image->data.F32[row][col] > image->data.F32[row+1][col]) && 121 115 (image->data.F32[row][col] >= image->data.F32[row+1][col+1])) { 122 116 // Add peak at location (row, col) … … 124 118 } else if (col < (image->numCols - 1)) { 125 119 if ( (image->data.F32[row][col] >= image->data.F32[row][col-1]) && 126 (image->data.F32[row][col] > image->data.F32[row][col+1]) &&120 (image->data.F32[row][col] > image->data.F32[row][col+1]) && 127 121 (image->data.F32[row][col] >= image->data.F32[row+1][col-1]) && 128 (image->data.F32[row][col] > image->data.F32[row+1][col]) &&129 (image->data.F32[row][col] >= image->data.F32[row+1][col+ 2])) {122 (image->data.F32[row][col] > image->data.F32[row+1][col]) && 123 (image->data.F32[row][col] >= image->data.F32[row+1][col+1])) { 130 124 // Add peak at location (row, col) 131 125 } … … 143 137 } 144 138 139 for (row = 1 ; row < (image->numRows - 1) ; row++) { 140 tmpRow = p_psGetRowVectorFromImage((psImage *) image, 0); 141 row1 = pmFindVectorPeeks(tmpRow, threshold); 142 143 // Step through all local peask in this row. 144 for (psU32 i = 0 ; i < row1->n ; i++ ) { 145 col = row1->data.U32[i]; 146 147 if ((image->data.F32[row][col] >= image->data.F32[row-1][col-1]) && 148 (image->data.F32[row][col] > image->data.F32[row-1][col]) && 149 (image->data.F32[row][col] >= image->data.F32[row-1][col+1]) && 150 (image->data.F32[row][col] > image->data.F32[row][col-1]) && 151 (image->data.F32[row][col] >= image->data.F32[row][col+1]) && 152 (image->data.F32[row][col] >= image->data.F32[row+1][col-1]) && 153 (image->data.F32[row][col] >= image->data.F32[row+1][col]) && 154 (image->data.F32[row][col] >= image->data.F32[row+1][col+1])) { 155 // Add peak at location (row, col) 156 } 157 } 158 } 159 145 160 row = image->numRows - 1; 161 tmpRow = p_psGetRowVectorFromImage((psImage *) image, row); 162 row1 = pmFindVectorPeeks(tmpRow, threshold); 146 163 for (psU32 i = 0 ; i < row1->n ; i++ ) { 147 164 col = row1->data.U32[i]; 148 165 if (col == 0) { 149 if ( (image->data.F32[row][col] > image->data.F32[row][col+1]) &&150 (image->data.F32[row][col] > image->data.F32[row+1][col]) &&151 (image->data.F32[row][col] > = image->data.F32[row+1][col+1])) {166 if ( (image->data.F32[row][col] > image->data.F32[row-1][col]) && 167 (image->data.F32[row][col] >= image->data.F32[row-1][col+1]) && 168 (image->data.F32[row][col] > image->data.F32[row][col+1])) { 152 169 // Add peak at location (row, col) 153 170 } 154 171 } else if (col < (image->numCols - 1)) { 155 if ( (image->data.F32[row][col] >= image->data.F32[row ][col-1]) &&156 (image->data.F32[row][col] > image->data.F32[row][col+1]) &&157 (image->data.F32[row][col] >= image->data.F32[row +1][col-1]) &&158 (image->data.F32[row][col] > image->data.F32[row+1][col]) &&159 (image->data.F32[row][col] >= image->data.F32[row +1][col+2])) {172 if ( (image->data.F32[row][col] >= image->data.F32[row-1][col-1]) && 173 (image->data.F32[row][col] > image->data.F32[row-1][col]) && 174 (image->data.F32[row][col] >= image->data.F32[row-1][col+1]) && 175 (image->data.F32[row][col] > image->data.F32[row][col-1]) && 176 (image->data.F32[row][col] >= image->data.F32[row][col+1])) { 160 177 // Add peak at location (row, col) 161 178 } 162 179 163 180 } else if (col == (image->numCols - 1)) { 164 if ( (image->data.F32[row][col] >= image->data.F32[row][col-1]) && 165 (image->data.F32[row][col] > image->data.F32[row+1][col]) && 166 (image->data.F32[row][col] >= image->data.F32[row+1][col-1])) { 167 // Add peak at location (row, col) 168 } 169 181 if ( (image->data.F32[row][col] >= image->data.F32[row-1][col-1]) && 182 (image->data.F32[row][col] > image->data.F32[row-1][col]) && 183 (image->data.F32[row][col] > image->data.F32[row][col-1])) { 184 // Add peak at location (row, col) 185 } 170 186 } else { 171 187 printf("XXX: ERROR!\n"); 172 188 } 173 189 } 174 175 176 190 177 191 return(NULL);
Note:
See TracChangeset
for help on using the changeset viewer.
