[GRASS-user] Matching Histograms for Aerial Photography?

Greetings,

I am struggling to match histograms for various US states NAIP 1-meter aerial photography.

It appears that each state shown here has been equalized for each individual state except for Nevada and Arizona.

I have tried using r.rescale.eq with many different parameters but I cannot really get Nevada and Arizona to roughly match the intensities of the rest of the states. It is difficult to guess values that match because the images are quite large and when I attempt to use a thumbnail (say at 50m resolution), the parameters used for the 50m thumbnail don’t match when using the full resolution image.

Can anyone recommend how I might be able to get the histograms to match?

Thanks,

Jeshua Lacock
Founder/Engineer
<3DTOPO.com>
GlassPrinted.com

On 20/06/17 11:06, Jeshua Lacock wrote:

Greetings,

I am struggling to match histograms for various US states NAIP 1-meter
aerial photography.

It appears that each state shown here has been equalized for each
individual state except for Nevada and Arizona.

I have tried using r.rescale.eq with many different parameters but I
cannot really get Nevada and Arizona to roughly match the intensities of
the rest of the states. It is difficult to guess values that match
because the images are quite large and when I attempt to use a thumbnail
(say at 50m resolution), the parameters used for the 50m thumbnail don’t
match when using the full resolution image.

Can anyone recommend how I might be able to get the histograms to match?

You can try the addon: i.histo.match. You can install it with g.extension.

Moritz

On Jun 20, 2017, at 6:02 AM, Moritz Lennert <mlennert@club.worldonline.be> wrote:

You can try the addon: i.histo.match. You can install it with g.extension.

Hi Moritz,

Thanks for the suggestion. Currently the data is raster - I assume I will have to convert it to imagery?

I tried installing the extension, but it fails with an SSL certificate error. I don’t see anyway to ignore or use a non-secure transfer.

Here is the output:

GRASS 7.2.1 (naipWest):~ > g.extension extension=i.histo.match

Fetching <i.histo.match> from GRASS GIS Addons repository (be patient)...
Traceback (most recent call last):
  File "/opt/local/share/grass-7.2.1/scripts/g.extension", line 1733, in <module>
    sys.exit(main())
  File "/opt/local/share/grass-7.2.1/scripts/g.extension", line 1712, in main
    install_extension(source=source, url=url, xmlurl=xmlurl)
  File "/opt/local/share/grass-7.2.1/scripts/g.extension", line 683, in install_extension
    source=source, url=url)
  File "/opt/local/share/grass-7.2.1/scripts/g.extension", line 1146, in install_extension_std_platforms
    outdev=outdev, directory=srcdir, tmpdir=TMPDIR)
  File "/opt/local/share/grass-7.2.1/scripts/g.extension", line 1094, in download_source_code
    f, h = urlretrieve(url, zip_name)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 98, in urlretrieve
    return opener.retrieve(url, filename, reporthook, data)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 245, in retrieve
    fp = self.open(url, data)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 213, in open
    return getattr(self, name)(url)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 443, in open_https
    h.endheaders(data)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1038, in endheaders
    self._send_output(message_body)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 882, in _send_output
    self.send(msg)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 844, in send
    self.connect()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1263, in connect
    server_hostname=server_hostname)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 363, in wrap_socket
    _context=self)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 611, in __init__
    self.do_handshake()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 840, in do_handshake
    self._sslobj.do_handshake()
IOError: [Errno socket error] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)

Best,

Jeshua Lacock
Founder/Engineer
<3DTOPO.com>
GlassPrinted.com

On 21/06/17 08:03, Jeshua Lacock wrote:

On Jun 20, 2017, at 6:02 AM, Moritz Lennert <mlennert@club.worldonline.be> wrote:

You can try the addon: i.histo.match. You can install it with g.extension.

Hi Moritz,

Thanks for the suggestion. Currently the data is raster - I assume I will have to convert it to imagery?

imagery = raster. To be more precise, imagery is raster data in which pixel values are physical camera-like sensor values. But in terms of format they are identical, so no need to convert.

I tried installing the extension, but it fails with an SSL certificate error. I don’t see anyway to ignore or use a non-secure transfer.

I really cannot help you with that error. What you can do, however, is download the addon as a zip file from [1] and install directly from that zip with g.extension [...] url=/path/to/zipfile

Moritz

[1] https://trac.osgeo.org/grass/browser/grass-addons/grass7/imagery/i.histo.match?format=zip