PyCuAmpcor: cuDenseOffsets.py towork with input varying gross offsets

LT1AB
Lijun Zhu 2020-11-30 10:30:23 -08:00
parent 94caa1ea5c
commit 6d9f088975
1 changed files with 8 additions and 2 deletions

View File

@ -268,8 +268,14 @@ def estimateOffsetField(reference, secondary, inps=None):
if grossOffset.size != 2*numberWindows : if grossOffset.size != 2*numberWindows :
print('The input gross offsets do not match the number of windows {} by {} in int32 type'.format(objOffset.numberWindowDown, objOffset.numberWindowAcross)) print('The input gross offsets do not match the number of windows {} by {} in int32 type'.format(objOffset.numberWindowDown, objOffset.numberWindowAcross))
return 0; return 0;
grossOffset.reshape(numberWindows, 2) grossOffset = grossOffset.reshape(numberWindows, 2)
objOffset.setVaryingGrossOffset(grossOffset[:,0], grossOffset[:,1]) grossAzimuthOffset = grossOffset[:, 0]
grossRangeOffset = grossOffset[:, 1]
# enforce C-contiguous flag
grossAzimuthOffset = grossAzimuthOffset.copy(order='C')
grossRangeOffset = grossRangeOffset.copy(order='C')
# set varying gross offset
objOffset.setVaryingGrossOffset(grossAzimuthOffset, grossRangeOffset)
# check # check
objOffset.checkPixelInImageRange() objOffset.checkPixelInImageRange()