<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><div class="BodyFragment"><font size="2"><span style="font-size: 10pt;"><div class="PlainText"></div><div class="PlainText"><br></div><div class="PlainText">Here are links for comparing the results using the Landsat 7 images from the sc_08 demo data. I've zoomed in to shows the sharpened resolution and colors. The file names reference 3 different sharpening methods (brovey, IHS, and PCA), and 2 different histogram matching methods (CDF=cdf and mean/stdev=msd)</div><div class="PlainText"><br></div><div class="PlainText"><a href="https://www.dropbox.com/s/m3me8yyqrjqihmv/brovey_msdhist.png">https://www.dropbox.com/s/m3me8yyqrjqihmv/brovey_msdhist.png</a></div><div class="PlainText"><a href="https://www.dropbox.com/s/3rqvrzdhn6g8w75/brovey_cdfhist.png">https://www.dropbox.com/s/3rqvrzdhn6g8w75/brovey_cdfhist.png</a></div><div class="PlainText"><br></div><div class="PlainText"><a href="https://www.dropbox.com/s/2rvjd44dya8nrq8/ihs_msdhist.png">https://www.dropbox.com/s/2rvjd44dya8nrq8/ihs_msdhist.png</a></div><div class="PlainText"><a href="https://www.dropbox.com/s/hja31kvudb0yerz/ihs_cdfhist.png">https://www.dropbox.com/s/hja31kvudb0yerz/ihs_cdfhist.png</a></div><div class="PlainText"><br></div><div class="PlainText"><a href="https://www.dropbox.com/s/5yxp75or1ybj510/pca_msdhist.png">https://www.dropbox.com/s/5yxp75or1ybj510/pca_msdhist.png</a></div><div class="PlainText"><a href="https://www.dropbox.com/s/7bfe71i7sbrze39/pca_cdfhist.png">https://www.dropbox.com/s/7bfe71i7sbrze39/pca_cdfhist.png</a></div><div class="PlainText"><br></div><div class="PlainText"><br></div><div class="PlainText">Michael</div></span></font></div><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>____________________</div><div>C. Michael Barton</div><div>Director, Center for Social Dynamics & Complexity </div><div>Professor of Anthropology, School of Human Evolution & Social Change</div><div>Arizona State University</div><div><br></div>voice: <span class="Apple-tab-span" style="white-space: pre; ">  </span>480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)<br>fax:          480-965-7671 (SHESC),  480-727-0709 (CSDC)<br><div>www: <a href="http://www.public.asu.edu/~cmbarton">http://www.public.asu.edu/~cmbarton</a>, <a href="http://csdc.asu.edu">http://csdc.asu.edu</a></div><br></div><br></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br><div><div>On Nov 21, 2013, at 1:20 PM, Michael Barton <<a href="mailto:michael.barton@asu.edu">michael.barton@asu.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<div>
<div class="BodyFragment"><font size="2"><span style="font-size:10pt;">
<div class="PlainText">I tried to implement this as an alternate way of histogram matching in i.pansharpen (attached as i.pansharpen3). It works and gives different colors, but it no longer sharpens. I’m attaching the code for you to look at (new method matchhist_mean_sd).
 I’m tied up the rest of the afternoon. So maybe someone else can puzzle this out.<br>
<br>
Michael<br>
<br>
</div>
</span></font></div>
<div class="BodyFragment"><font size="2"><span style="font-size:10pt;">
<div class="PlainText"><br>
____________________<br>
C. Michael Barton<br>
Director, Center for Social Dynamics & Complexity <br>
Professor of Anthropology, School of Human Evolution & Social Change<br>
Arizona State University<br>
<br>
voice:   480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)<br>
fax:          480-965-7671 (SHESC),  480-727-0709 (CSDC)<br>
www: <a href="http://www.public.asu.edu/~cmbarton">http://www.public.asu.edu/~cmbarton</a>,
<a href="http://csdc.asu.edu/">http://csdc.asu.edu</a><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
On Nov 21, 2013, at 12:38 AM, Nikos Alexandris <<a href="mailto:nik@nikosalexandris.net">nik@nikosalexandris.net</a>> wrote:<br>
<br>
> Nick Ves wrote:<br>
> <br>
>>> The HPF algorithm about the histrogram matching states "Stretch the<br>
>>> new multispectral image to match the mean and standard deviation of<br>
>>> the original (input) multispectral image"<br>
>>> In that context why it is wrong to do:<br>
> <br>
>>> Ouput <- output/sddev(output)*sddev(input)<br>
>>> Output <- Output - mean(output) + mean(input)<br>
> <br>
> Moritz Lennert:<br>
> <br>
>> To give the 'new' image the same mean and stddev of the 'input' image:<br>
>> (new - mean(new)) / stddev(new) * stddev(input) + mean(input)<br>
> <br>
> Not entirely sure, I think it works. Taken a fragment from the publicly <br>
> available QuickBird2 image over Sri Lanka (the extent shown at <br>
> <<a href="http://grasswiki.osgeo.org/wiki/File:RGB_04APR05050541-M2AS-000000186011_01_P001.jpg">http://grasswiki.osgeo.org/wiki/File:RGB_04APR05050541-M2AS-000000186011_01_P001.jpg</a>>),<br>
> <br>
> <br>
> get mean and sd for r, g and b<br>
> <br>
> # red<br>
> mean_red=321.375<br>
> sd_red=172.756<br>
> <br>
> # hpf_red<br>
> mean_red_hpf=321.364<br>
> sd_red_hpf=238.391<br>
> <br>
> # green<br>
> mean_green=434.033<br>
> sd_green=159.9<br>
> <br>
> # hpf_green<br>
> mean_green_hpf=434.02<br>
> sd_green=258.249<br>
> <br>
> # blue<br>
> mean_blue=285.168<br>
> sd_blue=75.0218<br>
> <br>
> # hpf_blue<br>
> mean_blue_hpf=285.161<br>
> sd_blue_hpf=145.395<br>
> <br>
> <br>
> and then<br>
> <br>
> r.mapcalc "hpf_red_histomatched = ( hpf_red - $mean_red_hpf ) / $sd_red_hpf * <br>
> $sd_red + $mean_red" --o<br>
> <br>
> r.mapcalc "hpf_blue_histomatched = ( hpf_blue - $mean_blue_hpf ) / <br>
> $sd_blue_hpf * $sd_blue + $mean_blue" --o<br>
> <br>
> r.mapcalc "hpf_green_histomatched = ( hpf_green - $mean_green_hpf ) / <br>
> $sd_green_hpf * $sd_green + $mean_green" --o<br>
> <br>
> <br>
> check output stats<br>
> <br>
> # r.univar hpf_red_histomatched<br>
> mean: 321.375<br>
> standard deviation: 172.756<br>
> <br>
> # r.univar hpf_green_histomatched<br>
> mean: 434.033<br>
> standard deviation: 159.9<br>
> <br>
> # r.univar hpf_blue_histomatched<br>
> mean: 285.168<br>
> standard deviation: 75.0217<br>
> <br>
> # reset colors to match originals doesn't play exactly nice, so<br>
> r.colors hpf_red_histomatched color=grey -e<br>
> # repeat for green, blue<br>
> <br>
> # draw<br>
> d.rgb ...<br>
> <br>
> <br>
> Looks nice! Is it that?<br>
> <br>
> Nikos<br>
<br>
</div>
</span></font></div>
</div>

<span><i.pansharpen3></span></blockquote></div><br></div></body></html>