IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6287


Ignore:
Timestamp:
Feb 1, 2006, 12:24:05 PM (20 years ago)
Author:
magnier
Message:

changed output of pmFindImagePeaks to parent coords; propagated change to pmSourceRoughClass

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_rel9_p0/psModules/src/objects/pmObjects.c

    r6183 r6287  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.5.4.4 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2006-01-22 21:12:19 $
     8 *  @version $Revision: 1.5.4.5 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2006-02-01 22:24:05 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    438438XXX: In the output psArray elements, should we use the image row/column offsets?
    439439     Currently, we do not.
     440XXX EAM : this function needs to return peaks in *parent* coords
    440441 
    441442XXX: Merge with CVS 1.20.  This had the proper code for images with a single
    442443row or column.
     444 
    443445*****************************************************************************/
    444446psArray *pmFindImagePeaks(const psImage *image,
     
    458460    psArray *list = NULL;
    459461
     462    psU32 col0 = image->col0;
     463    psU32 row0 = image->row0;
     464
    460465    //
    461466    // Find peaks in row 0 only.
     
    464469    tmpRow = getRowVectorFromImage((psImage *) image, row);
    465470    psVector *row1 = pmFindVectorPeaks(tmpRow, threshold);
     471    // pmFindVectorPeaks returns coords in the vector, not corrected for col0
    466472
    467473    for (psU32 i = 0 ; i < row1->n ; i++ ) {
     
    476482
    477483                if (image->data.F32[row][col] > threshold) {
    478                     list = myListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
     484                    list = myListAddPeak(list, row + row0, col + col0, image->data.F32[row][col], PM_PEAK_EDGE);
    479485                }
    480486            }
     
    486492                    (image->data.F32[row][col] >= image->data.F32[row+1][col+1])) {
    487493                if (image->data.F32[row][col] > threshold) {
    488                     list = myListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
     494                    list = myListAddPeak(list, row + row0, col + col0, image->data.F32[row][col], PM_PEAK_EDGE);
    489495                }
    490496            }
     
    495501                    (image->data.F32[row][col] >= image->data.F32[row+1][col-1])) {
    496502                if (image->data.F32[row][col] > threshold) {
    497                     list = myListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
     503                    list = myListAddPeak(list, row + row0, col + col0, image->data.F32[row][col], PM_PEAK_EDGE);
    498504                }
    499505            }
     
    534540                        (image->data.F32[row][col] >= image->data.F32[row+1][col+1])) {
    535541                    myType = PM_PEAK_EDGE;
    536                     list = myListAddPeak(list, row, col, image->data.F32[row][col], myType);
     542                    list = myListAddPeak(list, row + row0, col + col0, image->data.F32[row][col], myType);
    537543                }
    538544            } else if (col < (image->numCols - 1)) {
     
    569575                        }
    570576
    571                         list = myListAddPeak(list, row, col, image->data.F32[row][col], myType);
     577                        list = myListAddPeak(list, row + row0, col + col0, image->data.F32[row][col], myType);
    572578                    }
    573579                }
     
    581587                        (image->data.F32[row][col] >= image->data.F32[row+1][col])) {
    582588                    myType = PM_PEAK_EDGE;
    583                     list = myListAddPeak(list, row, col, image->data.F32[row][col], myType);
     589                    list = myListAddPeak(list, row + row0, col + col0, image->data.F32[row][col], myType);
    584590                }
    585591            } else {
     
    605611                    (image->data.F32[row][col] >  image->data.F32[row][col+1])) {
    606612                if (image->data.F32[row][col] > threshold) {
    607                     list = myListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
     613                    list = myListAddPeak(list, row + row0, col + col0, image->data.F32[row][col], PM_PEAK_EDGE);
    608614                }
    609615            }
     
    615621                    (image->data.F32[row][col] >= image->data.F32[row][col+1])) {
    616622                if (image->data.F32[row][col] > threshold) {
    617                     list = myListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
     623                    list = myListAddPeak(list, row + row0, col + col0, image->data.F32[row][col], PM_PEAK_EDGE);
    618624                }
    619625            }
     
    624630                    (image->data.F32[row][col] >  image->data.F32[row][col-1])) {
    625631                if (image->data.F32[row][col] > threshold) {
    626                     list = myListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE);
     632                    list = myListAddPeak(list, row + row0, col + col0, image->data.F32[row][col], PM_PEAK_EDGE);
    627633                }
    628634            }
     
    730736XXX: Sync with IfA on whether the peak x/y coords are data structure coords,
    731737     or they use the image row/column offsets.
     738XXX  EAM : peak->x,y uses parent coordinates
    732739 
    733740XXX: Should we simply set pmSource->peak = peak?  If so, should we increase
     
    12041211
    12051212        // XXX EAM : can we use the value of SATURATE if mask is NULL?
    1206         inner = psRegionForSquare (tmpSrc->peak->x - tmpSrc->mask->col0, tmpSrc->peak->y - tmpSrc->mask->row0, 2);
     1213        // inner = psRegionForSquare (tmpSrc->peak->x - tmpSrc->mask->col0, tmpSrc->peak->y - tmpSrc->mask->row0, 2);
     1214        inner = psRegionForSquare (tmpSrc->peak->x, tmpSrc->peak->y, 2);
    12071215        int Nsatpix = psImageCountPixelMask (tmpSrc->mask, inner, PSPHOT_MASK_SATURATED);
    12081216
Note: See TracChangeset for help on using the changeset viewer.