<div dir="ltr">Hey guys,<br><br>I realize this is borderline impossible to debug with what I've given you.  So I managed to reproduce it with the C++ code at the bottom of the email.  The image i used is: <a href="https://www.dropbox.com/s/i9fxstyuf8eqe8t/testsingleband.tif?dl=0">https://www.dropbox.com/s/i9fxstyuf8eqe8t/testsingleband.tif?dl=0</a><br><br>Something that is a little weird is that I cropped this image so recreating the problem is less clunky. When I did that, the artifacts were not present!  So, that's the reason i'm including a 65mb image.  (Perhaps Matt was on to something when he thought about gdal chunking bigger images.)  Using this code and this image, you should see the first nonzero row is too dark, and the second row is too bright.<div><br>Let me know if anyone can recreate the issue and/or has any further ideas.<br><br>Thanks again,<br>Mike<br><br><br><br><div><div>int pushUpToRight(void *hTransforArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)</div><div>{</div><div><span class="" style="white-space:pre">        </span>//First transform to georeferenced units:</div><div><span class="" style="white-space:pre">  </span>GDALGenImgProjTransform(hTransforArg, 0, nPointCount, x, y, z, panSuccess);</div><div><span class="" style="white-space:pre">        </span>//Now we are in georeferenced units</div><div><br></div><div>        //push up and to the right</div><div><span class="" style="white-space:pre">  </span>for (int i = 0; i<nPointCount; i++)</div><div><span class="" style="white-space:pre">     </span>{</div><div><span class="" style="white-space:pre">          </span>if (panSuccess[i] != 0)</div><div><span class="" style="white-space:pre">            </span>{</div><div><span class="" style="white-space:pre">                  </span>x[i] = x[i] + .01;</div><div><span class="" style="white-space:pre">                 </span>y[i] = y[i] + .651;</div><div><span class="" style="white-space:pre">                </span>}</div><div><span class="" style="white-space:pre">  </span>}</div><div><span class="" style="white-space:pre">  </span></div><div><span class="" style="white-space:pre">   </span>double *geo = new double[6]; //hardcoded for this example</div><div><span class="" style="white-space:pre">  </span>geo[0] = 451581.6;<span class="" style="white-space:pre">        </span>geo[1] = 0.4;<span class="" style="white-space:pre">     </span>geo[2] = 0.0;<span class="" style="white-space:pre">     </span>geo[3] = 2420520.8000000003;<span class="" style="white-space:pre">      </span>geo[4] = 0.0;<span class="" style="white-space:pre">     </span>geo[5] = -0.4;</div><div><br></div><div><span class="" style="white-space:pre">    </span>//Now convert to pixels</div><div><span class="" style="white-space:pre">    </span>for (int i = 0; i < nPointCount; i++)</div><div><span class="" style="white-space:pre">   </span>{</div><div><span class="" style="white-space:pre">          </span>x[i] = convertXToPixel(x[i], geo);</div><div><span class="" style="white-space:pre">         </span>y[i] = convertYToPixel(y[i], geo);</div><div><span class="" style="white-space:pre"> </span>}</div><div><br></div><div><span class="" style="white-space:pre"> </span>return 1;</div><div>}</div><div>double convertXToPixel(double xGeo, double *adfGeoTransform) {<span class="" style="white-space:pre">    </span>return ((xGeo - adfGeoTransform[0]) / adfGeoTransform[1]);}</div><div>double convertYToPixel(double yGeo, double *adfGeoTransform) {<span class="" style="white-space:pre">  </span>return ((yGeo - adfGeoTransform[3]) / adfGeoTransform[5]);}</div><div><br></div><div>int main()</div><div>{</div><div><span class="" style="white-space:pre">      </span>GDALDataset *poDataset;</div><div><span class="" style="white-space:pre">    </span>GDALDriver *hDriver;</div><div><span class="" style="white-space:pre">       </span>GDALDataset *hDstDS;</div><div><br></div><div><span class="" style="white-space:pre">      </span>GDALAllRegister();</div><div><br></div><div><span class="" style="white-space:pre">        </span>// Open the source file</div><div><span class="" style="white-space:pre">    </span>poDataset = (GDALDataset *)GDALOpen("E:/Test/TestSingleBand.tif", GA_ReadOnly);</div><div><span class="" style="white-space:pre">  </span>CPLAssert(poDataset != NULL);</div><div><br></div><div><span class="" style="white-space:pre">     </span>// Get output driver (GeoTIFF format)</div><div><span class="" style="white-space:pre">      </span>hDriver = (GDALDriver*)GDALGetDriverByName("GTiff");</div><div><span class="" style="white-space:pre">     </span>CPLAssert(hDriver != NULL);</div><div>    </div><div><span class="" style="white-space:pre">  </span>// Create the output file.  </div><div><span class="" style="white-space:pre">      </span>hDstDS = hDriver->CreateCopy("E:/Test/out.tif", poDataset,FALSE,NULL,NULL,NULL);</div><div><span class="" style="white-space:pre">      </span>CPLAssert(hDstDS != NULL);</div><div><br></div><div><span class="" style="white-space:pre">        </span>//Create the transformer</div><div><span class="" style="white-space:pre">   </span>void *hTransformArgForward;</div><div><span class="" style="white-space:pre">        </span>hTransformArgForward = GDALCreateGenImgProjTransformer2(poDataset, NULL, NULL);</div><div><br></div><div>        //Create the warper and set various variables</div><div><span class="" style="white-space:pre">   </span>GDALWarpOptions *psWarpOptions = GDALCreateWarpOptions();</div><div><br></div><div><span class="" style="white-space:pre"> </span>psWarpOptions->padfSrcNoDataReal = (double *)CPLMalloc(psWarpOptions->nBandCount*sizeof(double));</div><div><span class="" style="white-space:pre">    </span>for (int ii = 0; ii < psWarpOptions->nBandCount; ii++)</div><div><span class="" style="white-space:pre">       </span>{</div><div><span class="" style="white-space:pre">          </span>psWarpOptions->padfSrcNoDataReal[ii] = 0;</div><div><span class="" style="white-space:pre">       </span>}</div><div><span class="" style="white-space:pre">  </span>psWarpOptions->hSrcDS = poDataset;</div><div><span class="" style="white-space:pre">      </span>psWarpOptions->hDstDS = hDstDS;</div><div><span class="" style="white-space:pre"> </span>psWarpOptions->nBandCount = GDALGetRasterCount(poDataset);</div><div><span class="" style="white-space:pre">      </span>psWarpOptions->pTransformerArg = hTransformArgForward;</div><div><span class="" style="white-space:pre">  </span>psWarpOptions->panSrcBands = (int *)CPLMalloc(sizeof(int));</div><div><span class="" style="white-space:pre">     </span>psWarpOptions->panSrcBands[0] = 1;</div><div><span class="" style="white-space:pre">      </span>psWarpOptions->panDstBands = (int *)CPLMalloc(sizeof(int));</div><div><span class="" style="white-space:pre">     </span>psWarpOptions->panDstBands[0] = 1;</div><div><span class="" style="white-space:pre">      </span>psWarpOptions->eResampleAlg = GRA_Cubic;</div><div><span class="" style="white-space:pre">        </span>psWarpOptions->pfnProgress = GDALTermProgress;</div><div><br></div><div><span class="" style="white-space:pre"> </span>// Establish my transformer. </div><div>    GDALTransformerFunc myTransformer = &pushUpToRight;</div><div><span class="" style="white-space:pre"> </span>psWarpOptions->pfnTransformer = myTransformer;</div><div><br></div><div><span class="" style="white-space:pre"> </span>// Initialize and execute the warp operation. </div><div><span class="" style="white-space:pre">    </span>GDALWarpOperation oOperation;</div><div><span class="" style="white-space:pre">      </span>oOperation.Initialize(psWarpOptions);</div><div><span class="" style="white-space:pre">      </span>oOperation.ChunkAndWarpImage(0, 0,</div><div><span class="" style="white-space:pre">         </span>GDALGetRasterXSize(hDstDS),</div><div><span class="" style="white-space:pre">                </span>GDALGetRasterYSize(hDstDS));</div><div>    </div><div>        //clean</div><div><span class="" style="white-space:pre">       </span>GDALDestroyWarpOptions(psWarpOptions);</div><div><span class="" style="white-space:pre">     </span>GDALClose(hDstDS);</div><div><span class="" style="white-space:pre"> </span>GDALClose(poDataset);</div><div><br></div><div><span class="" style="white-space:pre">     </span>return 0;</div><div>}</div></div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 16, 2015 at 1:10 PM, Michael Aschenbeck <span dir="ltr"><<a href="mailto:m.g.aschenbeck@gmail.com" target="_blank">m.g.aschenbeck@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Some good ideas, thanks for the suggestions.<div><br></div><div>I added padfDstNoDataReal, as well as the imaginary values.  I also set INIT_DEST to NODATA, although from what I read that was more of an option that affected speed.  Unfortunately my output was identical to the previous run and the artifacts remain present.</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 16, 2015 at 11:59 AM, Matt Hanson <span dir="ltr"><<a href="mailto:matt.a.hanson@gmail.com" target="_blank">matt.a.hanson@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Mike, <div>Are you setting <span style="font-size:12.8000001907349px">padfDstNoDataReal as well?     Because GDAL performs the warp in chunks I'm wondering if previously written data, that should be NoData, is not recognized as such with later chunks.   However, I'm still not clear on the exact details of how that works internally, Even would have a better idea if this even makes sense.</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div>The code I'm using to set WarpOptions for doing warping on multiple input images to a single outout looks like the below.   Also, are you setting INIT_DEST option to "NODATA" (it's one of the key-value options that are assigned to <span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre-wrap">psWarpOptions->papszWarpOptions).    </span></div><div><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre-wrap"><br></span></div><div><font color="#333333" face="Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;line-height:16.7999992370605px;white-space:pre-wrap">Hope this helps!</span></font></div><div><br></div><div><table style="border-collapse:collapse;border-spacing:0px;color:rgb(51,51,51);font-family:Helvetica,arial,nimbussansl,liberationsans,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:13px;line-height:18.2000007629395px"><tbody><tr><td style="padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td style="padding:0px 10px;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;vertical-align:top;white-space:pre-wrap;overflow:visible;word-wrap:normal">        GDALWarpOptions *psWarpOptions = <span style="color:rgb(0,134,179)">GDALCreateWarpOptions</span>();</td></tr><tr><td style="padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td style="padding:0px 10px;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;vertical-align:top;white-space:pre-wrap;overflow:visible;word-wrap:normal">        psWarpOptions->hDstDS = imgout.<span style="color:rgb(0,134,179)">GetGDALDataset</span>();</td></tr><tr><td style="padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td style="padding:0px 10px;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;vertical-align:top;white-space:pre-wrap;overflow:visible;word-wrap:normal">        psWarpOptions->nBandCount = imgout.<span style="color:rgb(0,134,179)">NumBands</span>();</td></tr><tr><td style="padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td style="padding:0px 10px;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;vertical-align:top;white-space:pre-wrap;overflow:visible;word-wrap:normal">        psWarpOptions->panSrcBands = (<span style="color:rgb(167,29,93)">int</span> *) <span style="color:rgb(0,134,179)">CPLMalloc</span>(<span style="color:rgb(167,29,93)">sizeof</span>(<span style="color:rgb(167,29,93)">int</span>) * psWarpOptions->nBandCount );</td></tr><tr><td style="padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td style="padding:0px 10px;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;vertical-align:top;white-space:pre-wrap;overflow:visible;word-wrap:normal">        psWarpOptions->panDstBands = (<span style="color:rgb(167,29,93)">int</span> *) <span style="color:rgb(0,134,179)">CPLMalloc</span>(<span style="color:rgb(167,29,93)">sizeof</span>(<span style="color:rgb(167,29,93)">int</span>) * psWarpOptions->nBandCount );</td></tr><tr><td style="padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td style="padding:0px 10px;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;vertical-align:top;white-space:pre-wrap;overflow:visible;word-wrap:normal">        psWarpOptions->padfSrcNoDataReal = (<span style="color:rgb(167,29,93)">double</span> *) <span style="color:rgb(0,134,179)">CPLMalloc</span>(<span style="color:rgb(167,29,93)">sizeof</span>(<span style="color:rgb(167,29,93)">double</span>) * psWarpOptions->nBandCount );</td></tr><tr><td style="padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td style="padding:0px 10px;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;vertical-align:top;white-space:pre-wrap;overflow:visible;word-wrap:normal">        psWarpOptions->padfSrcNoDataImag = (<span style="color:rgb(167,29,93)">double</span> *) <span style="color:rgb(0,134,179)">CPLMalloc</span>(<span style="color:rgb(167,29,93)">sizeof</span>(<span style="color:rgb(167,29,93)">double</span>) * psWarpOptions->nBandCount );</td></tr><tr><td style="padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td style="padding:0px 10px;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;vertical-align:top;white-space:pre-wrap;overflow:visible;word-wrap:normal">        psWarpOptions->padfDstNoDataReal = (<span style="color:rgb(167,29,93)">double</span> *) <span style="color:rgb(0,134,179)">CPLMalloc</span>(<span style="color:rgb(167,29,93)">sizeof</span>(<span style="color:rgb(167,29,93)">double</span>) * psWarpOptions->nBandCount );</td></tr><tr><td style="padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td style="padding:0px 10px;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;vertical-align:top;white-space:pre-wrap;overflow:visible;word-wrap:normal">        psWarpOptions->padfDstNoDataImag = (<span style="color:rgb(167,29,93)">double</span> *) <span style="color:rgb(0,134,179)">CPLMalloc</span>(<span style="color:rgb(167,29,93)">sizeof</span>(<span style="color:rgb(167,29,93)">double</span>) * psWarpOptions->nBandCount );</td></tr><tr><td style="padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td style="padding:0px 10px;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;vertical-align:top;white-space:pre-wrap;overflow:visible;word-wrap:normal">        <span style="color:rgb(167,29,93)">for</span> (<span style="color:rgb(167,29,93)">unsigned</span> <span style="color:rgb(167,29,93)">int</span> b=<span style="color:rgb(0,134,179)">0</span>;b<imgout.<span style="color:rgb(0,134,179)">NumBands</span>();b++) {</td></tr><tr><td style="padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td style="padding:0px 10px;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;vertical-align:top;white-space:pre-wrap;overflow:visible;word-wrap:normal">            psWarpOptions->panSrcBands[b] = b+<span style="color:rgb(0,134,179)">1</span>;</td></tr><tr><td style="padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td style="padding:0px 10px;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;vertical-align:top;white-space:pre-wrap;overflow:visible;word-wrap:normal">            psWarpOptions->panDstBands[b] = b+<span style="color:rgb(0,134,179)">1</span>;</td></tr><tr><td style="padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td style="padding:0px 10px;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;vertical-align:top;white-space:pre-wrap;overflow:visible;word-wrap:normal">            psWarpOptions->padfSrcNoDataReal[b] = images[<span style="color:rgb(0,134,179)">0</span>][b].<span style="color:rgb(0,134,179)">NoDataValue</span>();</td></tr><tr><td style="padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td style="padding:0px 10px;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;vertical-align:top;white-space:pre-wrap;overflow:visible;word-wrap:normal">            psWarpOptions->padfDstNoDataReal[b] = imgout[b].<span style="color:rgb(0,134,179)">NoDataValue</span>();</td></tr><tr><td style="padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td style="padding:0px 10px;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;vertical-align:top;white-space:pre-wrap;overflow:visible;word-wrap:normal">            psWarpOptions->padfSrcNoDataImag[b] = <span style="color:rgb(0,134,179)">0.0</span>;</td></tr><tr><td style="padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td style="padding:0px 10px;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;vertical-align:top;white-space:pre-wrap;overflow:visible;word-wrap:normal">            psWarpOptions->padfDstNoDataImag[b] = <span style="color:rgb(0,134,179)">0.0</span>;</td></tr><tr><td style="padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td style="padding:0px 10px;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;vertical-align:top;white-space:pre-wrap;overflow:visible;word-wrap:normal">        }
</td></tr></tbody></table></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Thu, Apr 16, 2015 at 1:42 PM, Michael Aschenbeck <span dir="ltr"><<a href="mailto:m.g.aschenbeck@gmail.com" target="_blank">m.g.aschenbeck@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Thanks for your reply.<br><br>I'm using gdal 1.10.1.  I'm using cubic resampling, but i have noticed the dark line artifact with bilinear as well.  I unfortunately do not reproduce the problem with a basic gdalwarp with cubic resampling.<br><br>I have written this code to do some registration. It's hard to tell in the example, but my transformation actually pushed pixels up a bit. The transformation I use handles interior pixels nicely and extends beyond the image, so there is nothing 'weird' going on with that near the boundary that I can think of.<br><br>I was hoping there is a warp option i have not yet thought of.<br><br>Thanks again,<br>Mike<br><br><br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 16, 2015 at 11:10 AM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>Le jeudi 16 avril 2015 19:01:57, Michael Aschenbeck a écrit :<br>
> Hello,<br>
><br>
> I'm using ChunkAndWarpMulti to warp an image.  The warping is working<br>
> nicely, however, at the boundary I seem to be getting some artifacts.<br>
><br>
> The first artifact i see is a DARK boundary of pixels in some location.  My<br>
> guess is that the interpolator is interpolating with blackfill (intensity<br>
> zero pixels).  Note that I am using the following setup:<br>
> psWarpOptions->padfSrcNoDataReal = (double *)<br>
> CPLMalloc(psWarpOptions->nBandCount*sizeof(double));<br>
> for (int ii = 0; ii < psWarpOptions->nBandCount; ii++)<br>
> {<br>
> psWarpOptions->padfSrcNoDataReal[ii] = 0;<br>
> }<br>
> which i thought was supposed to treat zeros as nodata.  It doesn't seem to<br>
> be doing what I think it should.<br>
><br>
> In some cases, I am also noticing a BRIGHT band strip of pixels adjacent to<br>
> the dark boundary pixels.  I don't have any thoughts on where this artifact<br>
> is coming from.<br>
><br>
> Below you can find links to an example.  The orange you see is just the<br>
> background color of my viewer.  Zero pixels are set to transparent so you<br>
> can see the dark boundary artifact.  (Note that all of the orange region is<br>
> covered with zero-intensity pixels, so we haven't reached the boundary of<br>
> the file, just the boundary of the non-zero pixels.)  Sorry if that's<br>
> confusing.<br>
> The before image: <a href="https://www.dropbox.com/s/3kmyi8wu0qybsq9/before.JPG?dl=0" target="_blank">https://www.dropbox.com/s/3kmyi8wu0qybsq9/before.JPG?dl=0</a><br>
> The after image with the artifacts:<br>
> <a href="https://www.dropbox.com/s/fo0m8q95b26s61m/after.JPG?dl=0" target="_blank">https://www.dropbox.com/s/fo0m8q95b26s61m/after.JPG?dl=0</a><br>
><br>
<br>
</div></div>Mike,<br>
<br>
Which gdal version ? Which resampling method ?<br>
Do you reproduce with gdalwarp ?<br>
If so, providing input file + full gdalwarp command line would help.<br>
<span><font color="#888888"><br>
Even<br>
<br>
--<br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a><br>
</font></span></blockquote></div><br></div>
</div></div><br></div></div>_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>