- Timestamp:
- 08/07/12 18:28:59 (12 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/GenericEdgeDetector.cpp
r2626 r2632 109 109 const Double *y_p = dir_p + 1 ; 110 110 for ( uInt i = 0 ; i < len ; i++ ) { 111 *px_p = pcenx_ + ( *x_p - cenx_ ) / dx_ ;111 *px_p = pcenx_ + ( *x_p - cenx_ ) * decCorr_ / dx_ ; 112 112 *py_p = pceny_ + ( *y_p - ceny_ ) / dy_ ; 113 113 px_p += 2 ; … … 123 123 os_.origin(LogOrigin( "GenericEdgeDetector", "setup", WHERE )) ; 124 124 125 Double xmax, xmin, ymax, ymin ; 126 minMax( xmin, xmax, dir_.row( 0 ) ) ; 127 minMax( ymin, ymax, dir_.row( 1 ) ) ; 128 Double wx = ( xmax - xmin ) * 1.1 ; 129 Double wy = ( ymax - ymin ) * 1.1 ; 130 131 cenx_ = 0.5 * ( xmin + xmax ) ; 132 ceny_ = 0.5 * ( ymin + ymax ) ; 133 decCorr_ = 1.0 / cos( ceny_ ) ; 134 125 135 uInt len = time_.nelements() ; 126 136 Matrix<Double> dd = dir_.copy() ; 127 137 for ( uInt i = len-1 ; i > 0 ; i-- ) { 128 dd(0,i) = dd(0,i) - dd(0,i-1);138 dd(0,i) = ( dd(0,i) - dd(0,i-1) ) * decCorr_ ; 129 139 dd(1,i) = dd(1,i) - dd(1,i-1) ; 130 140 } … … 141 151 dir_.freeStorage( dir_p, b ) ; 142 152 Double med = median( dr, False, True, True ) ; 143 dx_ = med * width_ ; 144 dy_ = dx_ ; 145 146 Double xmax, xmin, ymax, ymin ; 147 minMax( xmin, xmax, dir_.row( 0 ) ) ; 148 minMax( ymin, ymax, dir_.row( 1 ) ) ; 149 Double wx = ( xmax - xmin ) * 1.1 ; 150 Double wy = ( ymax - ymin ) * 1.1 ; 151 152 cenx_ = 0.5 * ( xmin + xmax ) ; 153 ceny_ = 0.5 * ( ymin + ymax ) ; 153 dy_ = med * width_ ; 154 dx_ = dy_ * decCorr_ ; 154 155 155 156 nx_ = uInt( ceil( wx / dx_ ) ) ; -
trunk/src/GenericEdgeDetector.h
r2617 r2632 62 62 casa::Double dx_ ; 63 63 casa::Double dy_ ; 64 casa::Double decCorr_ ; 64 65 65 66 // storage for detection
Note:
See TracChangeset
for help on using the changeset viewer.