[gdal-dev] Interpolation questions

Daniele Romagnoli daniele.romagnoli at geo-solutions.it
Wed Mar 29 01:07:07 PDT 2017


Hi,
While investigating on some rendering issues we have with java JAI based
operations involving interpolations, I have found the topic of bicubic
interpolation introducing values outside of the input dynamic, as well as
negative values and overshooting.

The problem we had was with a grayscale GeoTIFF with noData=0.
For some very dark area (pixel near to zero) the output of the
interpolation was a negative value being clamped to zero (which is noData).
So it was introducing noData in regions where all pixels were valid.

Therefore I did a test with gdal_translate -r cubic and I got same result:


​
on the left side: original image
on the right side: cubic interpolation
weird white shapes you see on the top right are zero/nodata pixels.

I got different result once using cubic spline instead.
What is the difference between the two algorithms?

Second question:
I did a gdal_translate -outsize 800% 800% from a small pixellated image.
is it expected to have output pixels exceeding the original shape of the
valid input pixels?
I was thinking the interpolated image pixels should stay within the
original pixel edges.

Let me provide an image to clarify:

​
​
Left image: original
Right image: cubic spline.
See how the 2 edges are different, having the cubic spline producing some
kind of buffering on the edge (note the white-missing pixels on the borders
are nodata).

Please, let me know.
Best Regards,
Daniele



-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==

Ing. Daniele Romagnoli
Senior Software Engineer

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:      +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170329/ee912dde/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: layers.jpeg
Type: image/jpeg
Size: 11979 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170329/ee912dde/attachment-0001.jpeg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: interpolated.jpg
Type: image/jpeg
Size: 14400 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170329/ee912dde/attachment-0001.jpg>


More information about the gdal-dev mailing list