Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
da95af1
sm r3.4
Sep 19, 2023
3a8e2ec
merge R4.0.2beta-1
Mar 11, 2024
b6cfbbb
change the SM commit id for R4.0.2
May 23, 2024
f764f2f
merge upstream develop branch
Jun 4, 2024
a920ae6
Merge remote-tracking branch 'upstream/develop' into develop
Jun 5, 2024
1d28fae
Merge remote-tracking branch 'upstream/develop' into develop
Jun 13, 2024
84f3874
Merge remote-tracking branch 'upstream/develop' into develop
Aug 12, 2024
2bb897a
Merge remote-tracking branch 'upstream/develop' into develop
Sep 14, 2024
da76f88
Merge branch 'develop' of https://github-fn.jpl.nasa.gov/isce-3/isce …
Oct 2, 2024
6313217
Merge branch 'develop' of https://github-fn.jpl.nasa.gov/isce-3/isce …
Oct 9, 2024
ce2b301
Merge branch 'develop' of https://github-fn.jpl.nasa.gov/isce-3/isce …
Oct 15, 2024
8394511
Merge branch 'develop' of https://github-fn.jpl.nasa.gov/isce-3/isce …
Oct 24, 2024
72645bd
Merge branch 'develop' of https://github-fn.jpl.nasa.gov/isce-3/isce …
Oct 29, 2024
6f93fd3
Merge branch 'develop' of https://github-fn.jpl.nasa.gov/isce-3/isce …
Dec 9, 2024
eebd988
Merge branch 'develop' of https://github-fn.jpl.nasa.gov/isce-3/isce …
Jan 21, 2025
9b108ce
Merge branch 'develop' of https://github-fn.jpl.nasa.gov/isce-3/isce …
Jan 29, 2025
b1c78f7
Merge branch 'develop' of https://github-fn.jpl.nasa.gov/isce-3/isce …
Mar 18, 2025
e46f53f
Merge branch 'develop' of https://github-fn.jpl.nasa.gov/isce-3/isce …
Apr 10, 2025
54d6ab4
Merge branch 'develop' of https://github-fn.jpl.nasa.gov/isce-3/isce …
May 12, 2025
73b6b9b
Merge branch 'develop' of https://github-fn.jpl.nasa.gov/isce-3/isce …
Jun 10, 2025
2eb1387
Merge branch 'develop' of https://github.com/isce-framework/isce3 int…
Sep 30, 2025
42f2514
Merge branch 'develop' of https://github.com/isce-framework/isce3 int…
Nov 14, 2025
39c9883
Merge branch 'develop' of https://github.com/isce-framework/isce3 int…
Dec 1, 2025
f6cfd55
Merge branch 'develop' of https://github.com/isce-framework/isce3 int…
Jan 14, 2026
6176caa
Merge branch 'develop' of https://github.com/isce-framework/isce3 int…
Jan 16, 2026
1f111b3
Merge branch 'develop' of https://github.com/isce-framework/isce3 int…
Mar 23, 2026
0cf5e3b
Merge branch 'develop' of https://github.com/isce-framework/isce3 int…
Apr 2, 2026
41199fb
Merge branch 'develop' of https://github.com/isce-framework/isce3 int…
Apr 27, 2026
a0bbee4
Merge branch 'develop' of https://github.com/isce-framework/isce3 int…
May 27, 2026
948b25b
remove the mask description for the wrapped ifgram
May 27, 2026
a3bddfe
remove the tmp folder
May 27, 2026
aa375c3
fix minors
May 28, 2026
24ffd1c
comment out the checkPixelInImageRange
Jun 1, 2026
3e0839d
Merge branch 'develop' of https://github.com/isce-framework/isce3 int…
Jun 1, 2026
0c9d6a6
pycuampcor: fix the pixels out of range issue
Jun 4, 2026
f7c69c1
pycuampcor: fix an error in determining the corrwindow size
Jun 4, 2026
b236902
Merge branch 'develop' of https://github.com/isce-framework/isce3 int…
Jun 4, 2026
cfbdf5a
update the maximum search radius to be 256
Jun 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 34 additions & 43 deletions cxx/isce3/cuda/matchtemplate/pycuampcor/cuAmpcorParameter.cu
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ void cuAmpcorParameter::setupParameters()
windowSizeWidth = windowSizeWidthRaw*rawDataOversamplingFactor; //
windowSizeHeight = windowSizeHeightRaw*rawDataOversamplingFactor;

searchWindowSizeWidthRaw = windowSizeWidthRaw + 2*halfSearchRangeDownRaw;
searchWindowSizeHeightRaw = windowSizeHeightRaw + 2*halfSearchRangeAcrossRaw;
searchWindowSizeWidthRaw = windowSizeWidthRaw + 2*halfSearchRangeAcrossRaw;
searchWindowSizeHeightRaw = windowSizeHeightRaw + 2*halfSearchRangeDownRaw;

searchWindowSizeWidthRawZoomIn = windowSizeWidthRaw + 2*halfZoomWindowSizeRaw;
searchWindowSizeHeightRawZoomIn = windowSizeHeightRaw + 2*halfZoomWindowSizeRaw;
Expand Down Expand Up @@ -237,14 +237,28 @@ void cuAmpcorParameter::setChunkStartPixels()
if(sChunkEA < vpixel) sChunkEA = vpixel;
}
}
// Clamp chunk start pixels to valid image range
if (mChunkSD < 0) mChunkSD = 0;
if (mChunkSA < 0) mChunkSA = 0;
if (sChunkSD < 0) sChunkSD = 0;
if (sChunkSA < 0) sChunkSA = 0;
// Compute end pixels and clamp to image range
int mEndD = mChunkED + windowSizeHeightRaw;
if (mEndD > referenceImageHeight) mEndD = referenceImageHeight;
int mEndA = mChunkEA + windowSizeWidthRaw;
if (mEndA > referenceImageWidth) mEndA = referenceImageWidth;
int sEndD = sChunkED + searchWindowSizeHeightRaw;
if (sEndD > secondaryImageHeight) sEndD = secondaryImageHeight;
int sEndA = sChunkEA + searchWindowSizeWidthRaw;
if (sEndA > secondaryImageWidth) sEndA = secondaryImageWidth;
referenceChunkStartPixelDown[idxChunk] = mChunkSD;
referenceChunkStartPixelAcross[idxChunk] = mChunkSA;
secondaryChunkStartPixelDown[idxChunk] = sChunkSD;
secondaryChunkStartPixelAcross[idxChunk] = sChunkSA;
referenceChunkHeight[idxChunk] = mChunkED - mChunkSD + windowSizeHeightRaw;
referenceChunkWidth[idxChunk] = mChunkEA - mChunkSA + windowSizeWidthRaw;
secondaryChunkHeight[idxChunk] = sChunkED - sChunkSD + searchWindowSizeHeightRaw;
secondaryChunkWidth[idxChunk] = sChunkEA - sChunkSA + searchWindowSizeWidthRaw;
referenceChunkHeight[idxChunk] = mEndD - mChunkSD;
referenceChunkWidth[idxChunk] = mEndA - mChunkSA;
secondaryChunkHeight[idxChunk] = sEndD - sChunkSD;
secondaryChunkWidth[idxChunk] = sEndA - sChunkSA;
if(maxReferenceChunkHeight < referenceChunkHeight[idxChunk]) maxReferenceChunkHeight = referenceChunkHeight[idxChunk];
if(maxReferenceChunkWidth < referenceChunkWidth[idxChunk] ) maxReferenceChunkWidth = referenceChunkWidth[idxChunk];
if(maxSecondaryChunkHeight < secondaryChunkHeight[idxChunk]) maxSecondaryChunkHeight = secondaryChunkHeight[idxChunk];
Expand All @@ -256,60 +270,37 @@ void cuAmpcorParameter::setChunkStartPixels()
/// check whether reference and secondary windows are within the image range
void cuAmpcorParameter::checkPixelInImageRange()
{
#ifdef CUAMPCOR_DEBUG
int endPixel;
for(int row=0; row<numberWindowDown; row++)
{
for(int col = 0; col < numberWindowAcross; col++)
{
int i = row*numberWindowAcross + col;
if(referenceStartPixelDown[i] <0)
{
fprintf(stderr, "Reference Window start pixel out of range in Down, window (%d,%d), pixel %d\n", row, col, referenceStartPixelDown[i]);
exit(EXIT_FAILURE); //or raise range error
}
if(referenceStartPixelAcross[i] <0)
{
fprintf(stderr, "Reference Window start pixel out of range in Across, window (%d,%d), pixel %d\n", row, col, referenceStartPixelAcross[i]);
exit(EXIT_FAILURE);
}
if(referenceStartPixelDown[i] < 0)
fprintf(stderr, "Warning: Reference Window start pixel out of range in Down, window (%d,%d), pixel %d\n", row, col, referenceStartPixelDown[i]);
if(referenceStartPixelAcross[i] < 0)
fprintf(stderr, "Warning: Reference Window start pixel out of range in Across, window (%d,%d), pixel %d\n", row, col, referenceStartPixelAcross[i]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the previous behavior was to raise an exception when this check failed. The PR changes that behavior to emit a warning message instead. Could you explain the rationale behind this change?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point @seongsujeong , it is because they are not the issue anymore, and just warn the user that the window might out of range. @lijun99 has done the fix via filling 0. Please check his reply:

The isce3 version uses a strict range check, which could fail when we choose a specific starting pixel and some pixels from search image may fall out of range (at the edges). I have patched the code from the standalone version, which fills (0,0) when using pixels out of range. Now checkPixelInRange is optional.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Image loading/copying, zeros are now filled for out of range pixels (happening at edges if margins are not set properly or if we want to use a fixed start pixel location and vary chip sizes or search ranges). Of course, if it happens, the results along the edge are not reliable and therefore warnings may be issued. But it should not prevent the program from running.

Before the revision, accessing out of range pixels leads to memory access errors (seg fault, at least for CUDA), and therefore checking the range and raising an exception was the only plausible solution.

Note also that the above bug fixes have been included in the PyCuAmpcor V2 PR. Somehow, I forgot to patch V1. So, current version of ISCE2 has similar issues.

endPixel = referenceStartPixelDown[i] + windowSizeHeightRaw;
if(endPixel >= referenceImageHeight)
{
fprintf(stderr, "Reference Window end pixel out of range in Down, window (%d,%d), pixel %d\n", row, col, endPixel);
exit(EXIT_FAILURE);
}
fprintf(stderr, "Warning: Reference Window end pixel out of range in Down, window (%d,%d), pixel %d\n", row, col, endPixel);
endPixel = referenceStartPixelAcross[i] + windowSizeWidthRaw;
if(endPixel >= referenceImageWidth)
{
fprintf(stderr, "Reference Window end pixel out of range in Across, window (%d,%d), pixel %d\n", row, col, endPixel);
exit(EXIT_FAILURE);
}
fprintf(stderr, "Warning: Reference Window end pixel out of range in Across, window (%d,%d), pixel %d\n", row, col, endPixel);
//secondary
if(secondaryStartPixelDown[i] <0)
{
fprintf(stderr, "Secondary Window start pixel out of range in Down, window (%d,%d), pixel %d\n", row, col, secondaryStartPixelDown[i]);
exit(EXIT_FAILURE);
}
if(secondaryStartPixelAcross[i] <0)
{
fprintf(stderr, "Secondary Window start pixel out of range in Across, window (%d,%d), pixel %d\n", row, col, secondaryStartPixelAcross[i]);
exit(EXIT_FAILURE);
}
if(secondaryStartPixelDown[i] < 0)
fprintf(stderr, "Warning: Secondary Window start pixel out of range in Down, window (%d,%d), pixel %d\n", row, col, secondaryStartPixelDown[i]);
if(secondaryStartPixelAcross[i] < 0)
fprintf(stderr, "Warning: Secondary Window start pixel out of range in Across, window (%d,%d), pixel %d\n", row, col, secondaryStartPixelAcross[i]);
endPixel = secondaryStartPixelDown[i] + searchWindowSizeHeightRaw;
if(endPixel >= secondaryImageHeight)
{
fprintf(stderr, "Secondary Window end pixel out of range in Down, window (%d,%d), pixel %d\n", row, col, endPixel);
exit(EXIT_FAILURE);
}
fprintf(stderr, "Warning: Secondary Window end pixel out of range in Down, window (%d,%d), pixel %d\n", row, col, endPixel);
endPixel = secondaryStartPixelAcross[i] + searchWindowSizeWidthRaw;
if(endPixel >= secondaryImageWidth)
{
fprintf(stderr, "Secondary Window end pixel out of range in Across, window (%d,%d), pixel %d\n", row, col, endPixel);
exit(EXIT_FAILURE);
}

fprintf(stderr, "Warning: Secondary Window end pixel out of range in Across, window (%d,%d), pixel %d\n", row, col, endPixel);
}
}
#endif
}


Expand Down
26 changes: 17 additions & 9 deletions cxx/isce3/cuda/matchtemplate/pycuampcor/cuArraysCopy.cu
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void cuArraysCopyToBatch(cuArrays<float2> *image1, cuArrays<float2> *image2,

// kernel for cuArraysCopyToBatchWithOffset
template<typename T_in, typename T_out>
__global__ void cuArraysCopyToBatchWithOffset_kernel(const T_in *imageIn, const int inNY,
__global__ void cuArraysCopyToBatchWithOffset_kernel(const T_in *imageIn, const int inNX, const int inNY,
T_out *imageOut, const int outNX, const int outNY, const int nImages,
const int *offsetX, const int *offsetY)
{
Expand All @@ -77,8 +77,12 @@ __global__ void cuArraysCopyToBatchWithOffset_kernel(const T_in *imageIn, const
int outy = threadIdx.y + blockDim.y*blockIdx.y;
if(idxImage>=nImages || outx >= outNX || outy >= outNY) return;
int idxOut = idxImage*outNX*outNY + outx*outNY + outy;
int idxIn = (offsetX[idxImage]+outx)*inNY + offsetY[idxImage] + outy;
imageOut[idxOut] = T_out{imageIn[idxIn]};
int inx = offsetX[idxImage] + outx;
int iny = offsetY[idxImage] + outy;
if (inx >= 0 && inx < inNX && iny >= 0 && iny < inNY)
imageOut[idxOut] = T_out{imageIn[inx*inNY + iny]};
else
imageOut[idxOut] = T_out{0.0f};
}

/**
Expand All @@ -98,14 +102,14 @@ void cuArraysCopyToBatchWithOffset(cuArrays<float2> *image1, const int lda1, cuA
dim3 blockSize(nthreads, nthreads, 1);
dim3 gridSize(IDIVUP(image2->height,nthreads), IDIVUP(image2->width,nthreads), image2->count);
cuArraysCopyToBatchWithOffset_kernel<<<gridSize,blockSize, 0 , stream>>> (
image1->devData, lda1,
image1->devData, image1->height, lda1,
image2->devData, image2->height, image2->width, image2->count,
offsetH, offsetW);
getLastCudaError("cuArraysCopyToBatchAbsWithOffset_kernel");
}

// same as above, but from complex to real(take amplitudes)
__global__ void cuArraysCopyToBatchAbsWithOffset_kernel(const float2 *imageIn, const int inNY,
__global__ void cuArraysCopyToBatchAbsWithOffset_kernel(const float2 *imageIn, const int inNX, const int inNY,
float2 *imageOut, const int outNX, const int outNY, const int nImages,
const int *offsetX, const int *offsetY)
{
Expand All @@ -114,8 +118,12 @@ __global__ void cuArraysCopyToBatchAbsWithOffset_kernel(const float2 *imageIn, c
int outy = threadIdx.y + blockDim.y*blockIdx.y;
if(idxImage>=nImages || outx >= outNX || outy >= outNY) return;
int idxOut = idxImage*outNX*outNY + outx*outNY + outy;
int idxIn = (offsetX[idxImage]+outx)*inNY + offsetY[idxImage] + outy;
imageOut[idxOut] = make_float2(complexAbs(imageIn[idxIn]), 0.0);
int inx = offsetX[idxImage] + outx;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is an example that range is checked during copying and zeros are filled when out of range happens.

int iny = offsetY[idxImage] + outy;
if (inx >= 0 && inx < inNX && iny >= 0 && iny < inNY)
imageOut[idxOut] = make_float2(complexAbs(imageIn[inx*inNY + iny]), 0.0f);
else
imageOut[idxOut] = make_float2(0.0f, 0.0f);
}

/**
Expand All @@ -135,7 +143,7 @@ void cuArraysCopyToBatchAbsWithOffset(cuArrays<float2> *image1, const int lda1,
dim3 blockSize(nthreads, nthreads, 1);
dim3 gridSize(IDIVUP(image2->height,nthreads), IDIVUP(image2->width,nthreads), image2->count);
cuArraysCopyToBatchAbsWithOffset_kernel<<<gridSize,blockSize, 0 , stream>>> (
image1->devData, lda1,
image1->devData, image1->height, lda1,
image2->devData, image2->height, image2->width, image2->count,
offsetH, offsetW);
getLastCudaError("cuArraysCopyToBatchAbsWithOffset_kernel");
Expand All @@ -158,7 +166,7 @@ void cuArraysCopyToBatchWithOffsetR2C(cuArrays<float> *image1, const int lda1, c
dim3 blockSize(nthreads, nthreads, 1);
dim3 gridSize(IDIVUP(image2->height,nthreads), IDIVUP(image2->width,nthreads), image2->count);
cuArraysCopyToBatchWithOffset_kernel<<<gridSize,blockSize, 0 , stream>>> (
image1->devData, lda1,
image1->devData, image1->height, lda1,
image2->devData, image2->height, image2->width, image2->count,
offsetH, offsetW);
getLastCudaError("cuArraysCopyToBatchWithOffsetR2C_kernel");
Expand Down
77 changes: 34 additions & 43 deletions cxx/isce3/matchtemplate/pycuampcor/cuAmpcorParameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ void cuAmpcorParameter::setupParameters()
windowSizeWidth = windowSizeWidthRaw*rawDataOversamplingFactor; //
windowSizeHeight = windowSizeHeightRaw*rawDataOversamplingFactor;

searchWindowSizeWidthRaw = windowSizeWidthRaw + 2*halfSearchRangeDownRaw;
searchWindowSizeHeightRaw = windowSizeHeightRaw + 2*halfSearchRangeAcrossRaw;
searchWindowSizeWidthRaw = windowSizeWidthRaw + 2*halfSearchRangeAcrossRaw;
searchWindowSizeHeightRaw = windowSizeHeightRaw + 2*halfSearchRangeDownRaw;

searchWindowSizeWidthRawZoomIn = windowSizeWidthRaw + 2*halfZoomWindowSizeRaw;
searchWindowSizeHeightRawZoomIn = windowSizeHeightRaw + 2*halfZoomWindowSizeRaw;
Expand Down Expand Up @@ -239,14 +239,28 @@ void cuAmpcorParameter::setChunkStartPixels()
if(sChunkEA < vpixel) sChunkEA = vpixel;
}
}
// Clamp chunk start pixels to valid image range
if (mChunkSD < 0) mChunkSD = 0;
if (mChunkSA < 0) mChunkSA = 0;
if (sChunkSD < 0) sChunkSD = 0;
if (sChunkSA < 0) sChunkSA = 0;
// Compute end pixels and clamp to image range
int mEndD = mChunkED + windowSizeHeightRaw;
if (mEndD > referenceImageHeight) mEndD = referenceImageHeight;
int mEndA = mChunkEA + windowSizeWidthRaw;
if (mEndA > referenceImageWidth) mEndA = referenceImageWidth;
int sEndD = sChunkED + searchWindowSizeHeightRaw;
if (sEndD > secondaryImageHeight) sEndD = secondaryImageHeight;
int sEndA = sChunkEA + searchWindowSizeWidthRaw;
if (sEndA > secondaryImageWidth) sEndA = secondaryImageWidth;
referenceChunkStartPixelDown[idxChunk] = mChunkSD;
referenceChunkStartPixelAcross[idxChunk] = mChunkSA;
secondaryChunkStartPixelDown[idxChunk] = sChunkSD;
secondaryChunkStartPixelAcross[idxChunk] = sChunkSA;
referenceChunkHeight[idxChunk] = mChunkED - mChunkSD + windowSizeHeightRaw;
referenceChunkWidth[idxChunk] = mChunkEA - mChunkSA + windowSizeWidthRaw;
secondaryChunkHeight[idxChunk] = sChunkED - sChunkSD + searchWindowSizeHeightRaw;
secondaryChunkWidth[idxChunk] = sChunkEA - sChunkSA + searchWindowSizeWidthRaw;
referenceChunkHeight[idxChunk] = mEndD - mChunkSD;
referenceChunkWidth[idxChunk] = mEndA - mChunkSA;
secondaryChunkHeight[idxChunk] = sEndD - sChunkSD;
secondaryChunkWidth[idxChunk] = sEndA - sChunkSA;
if(maxReferenceChunkHeight < referenceChunkHeight[idxChunk]) maxReferenceChunkHeight = referenceChunkHeight[idxChunk];
if(maxReferenceChunkWidth < referenceChunkWidth[idxChunk] ) maxReferenceChunkWidth = referenceChunkWidth[idxChunk];
if(maxSecondaryChunkHeight < secondaryChunkHeight[idxChunk]) maxSecondaryChunkHeight = secondaryChunkHeight[idxChunk];
Expand All @@ -258,60 +272,37 @@ void cuAmpcorParameter::setChunkStartPixels()
/// check whether reference and secondary windows are within the image range
void cuAmpcorParameter::checkPixelInImageRange()
{
#ifdef CUAMPCOR_DEBUG
int endPixel;
for(int row=0; row<numberWindowDown; row++)
{
for(int col = 0; col < numberWindowAcross; col++)
{
int i = row*numberWindowAcross + col;
if(referenceStartPixelDown[i] <0)
{
fprintf(stderr, "Reference Window start pixel out ot range in Down, window (%d,%d), pixel %d\n", row, col, referenceStartPixelDown[i]);
exit(EXIT_FAILURE); //or raise range error
}
if(referenceStartPixelAcross[i] <0)
{
fprintf(stderr, "Reference Window start pixel out ot range in Across, window (%d,%d), pixel %d\n", row, col, referenceStartPixelAcross[i]);
exit(EXIT_FAILURE);
}
if(referenceStartPixelDown[i] < 0)
fprintf(stderr, "Warning: Reference Window start pixel out of range in Down, window (%d,%d), pixel %d\n", row, col, referenceStartPixelDown[i]);
if(referenceStartPixelAcross[i] < 0)
fprintf(stderr, "Warning: Reference Window start pixel out of range in Across, window (%d,%d), pixel %d\n", row, col, referenceStartPixelAcross[i]);
endPixel = referenceStartPixelDown[i] + windowSizeHeightRaw;
if(endPixel >= referenceImageHeight)
{
fprintf(stderr, "Reference Window end pixel out ot range in Down, window (%d,%d), pixel %d\n", row, col, endPixel);
exit(EXIT_FAILURE);
}
fprintf(stderr, "Warning: Reference Window end pixel out of range in Down, window (%d,%d), pixel %d\n", row, col, endPixel);
endPixel = referenceStartPixelAcross[i] + windowSizeWidthRaw;
if(endPixel >= referenceImageWidth)
{
fprintf(stderr, "Reference Window end pixel out ot range in Across, window (%d,%d), pixel %d\n", row, col, endPixel);
exit(EXIT_FAILURE);
}
fprintf(stderr, "Warning: Reference Window end pixel out of range in Across, window (%d,%d), pixel %d\n", row, col, endPixel);
//secondary
if(secondaryStartPixelDown[i] <0)
{
fprintf(stderr, "Secondary Window start pixel out ot range in Down, window (%d,%d), pixel %d\n", row, col, secondaryStartPixelDown[i]);
exit(EXIT_FAILURE);
}
if(secondaryStartPixelAcross[i] <0)
{
fprintf(stderr, "Secondary Window start pixel out ot range in Across, window (%d,%d), pixel %d\n", row, col, secondaryStartPixelAcross[i]);
exit(EXIT_FAILURE);
}
if(secondaryStartPixelDown[i] < 0)
fprintf(stderr, "Warning: Secondary Window start pixel out of range in Down, window (%d,%d), pixel %d\n", row, col, secondaryStartPixelDown[i]);
if(secondaryStartPixelAcross[i] < 0)
fprintf(stderr, "Warning: Secondary Window start pixel out of range in Across, window (%d,%d), pixel %d\n", row, col, secondaryStartPixelAcross[i]);
endPixel = secondaryStartPixelDown[i] + searchWindowSizeHeightRaw;
if(endPixel >= secondaryImageHeight)
{
fprintf(stderr, "Secondary Window end pixel out ot range in Down, window (%d,%d), pixel %d\n", row, col, endPixel);
exit(EXIT_FAILURE);
}
fprintf(stderr, "Warning: Secondary Window end pixel out of range in Down, window (%d,%d), pixel %d\n", row, col, endPixel);
endPixel = secondaryStartPixelAcross[i] + searchWindowSizeWidthRaw;
if(endPixel >= secondaryImageWidth)
{
fprintf(stderr, "Secondary Window end pixel out ot range in Across, window (%d,%d), pixel %d\n", row, col, endPixel);
exit(EXIT_FAILURE);
}

fprintf(stderr, "Warning: Secondary Window end pixel out of range in Across, window (%d,%d), pixel %d\n", row, col, endPixel);
}
}
#endif
}


Expand Down
Loading
Loading