IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3088


Ignore:
Timestamp:
Jan 24, 2005, 4:42:27 PM (21 years ago)
Author:
gusciora
Message:

getting there...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/pmObjects.c

    r3086 r3088  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-01-25 01:22:12 $
     7 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-01-25 02:42:27 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    104104    psU32 col = 0;
    105105    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);
    109109    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;
    116110    for (psU32 i = 0 ; i < row1->n ; i++ ) {
    117111        col = row1->data.U32[i];
    118112        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]) &&
    121115                    (image->data.F32[row][col] >= image->data.F32[row+1][col+1])) {
    122116                // Add peak at location (row, col)
     
    124118        } else if (col < (image->numCols - 1)) {
    125119            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]) &&
    127121                    (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])) {
    130124                // Add peak at location (row, col)
    131125            }
     
    143137    }
    144138
     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
    145160    row = image->numRows - 1;
     161    tmpRow = p_psGetRowVectorFromImage((psImage *) image, row);
     162    row1 = pmFindVectorPeeks(tmpRow, threshold);
    146163    for (psU32 i = 0 ; i < row1->n ; i++ ) {
    147164        col = row1->data.U32[i];
    148165        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])) {
    152169                // Add peak at location (row, col)
    153170            }
    154171        } 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])) {
    160177                // Add peak at location (row, col)
    161178            }
    162179
    163180        } 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            }
    170186        } else {
    171187            printf("XXX: ERROR!\n");
    172188        }
    173189    }
    174 
    175 
    176190
    177191    return(NULL);
Note: See TracChangeset for help on using the changeset viewer.