New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Histogram Equalization #1668

Merged
merged 13 commits into from Oct 20, 2016

Conversation

Projects
None yet
2 participants
@jamesmcclain
Member

jamesmcclain commented Oct 9, 2016

Still Needs:

  • #1665 (contains commits from that PR)
  • Implicit Methods
  • Unit Tests
  • Resolution of questions concerning equalization of signed cell types (see pictures below)

Singleband

Unequalized:
screenshot from 2016-10-09 13 02 10

Equalized (signed values being treated as unsigned by GIMP):
screenshot from 2016-10-09 13 02 17

Equalized (signed values being treated as signed by GeoServer):
screenshot from 2016-10-10 09 48 51

Multiband

Original:
screenshot from 2016-10-18 14 20 19

GIMP histogram equalization (Colors -> Auto -> Equalize)
screenshot from 2016-10-18 14 20 35

Histogram equalization using this PR
screenshot from 2016-10-18 14 21 25

Original bands:
tc_ng_baghdad_iq_geo-red
tc_ng_baghdad_iq_geo-green
tc_ng_baghdad_iq_geo-blue

Equalized bands (using this PR):
out-red
out-green
out-blue

@jamesmcclain jamesmcclain force-pushed the jamesmcclain:feature/histogram-equalization branch 2 times, most recently from 0fa772a to e3c3fce Oct 10, 2016

private def _T(cellType: CellType, cdf: Array[(Double, Double)])(x: Double): Double = {
val i = java.util.Arrays.binarySearch(cdf, (x, 0.0), cmp)
val bits = cellType.bits
val cdf_x =

This comment has been minimized.

@lossyrob

lossyrob Oct 10, 2016

Member

More verbose variable names or comments would make this code a lot easier to read.

This comment has been minimized.

@jamesmcclain

jamesmcclain Oct 10, 2016

Member

Okay, will-do.

trait MultibandEqualizationMethods extends MethodExtensions[MultibandTile] {
def equalize(histograms: Array[StreamingHistogram]): MultibandTile = HistogramEqualization(self, histograms)

This comment has been minimized.

@lossyrob

lossyrob Oct 10, 2016

Member

Can this only work with streaming histograms, or our histogram type in general?

This comment has been minimized.

@jamesmcclain

jamesmcclain Oct 10, 2016

Member

It currently relies on the ability to get the CDF associated with the histogram directly form it. I could add that capability to the other histogram types, but only StreamingHistogram has it right now.

@lossyrob

This comment has been minimized.

Member

lossyrob commented Oct 10, 2016

I would be very curious to see the same sort of set of screenshots for RGB imagery, for instance a before-and-after landsat w/ histogram equalization on each band.

@jamesmcclain jamesmcclain force-pushed the jamesmcclain:feature/histogram-equalization branch from e3c3fce to 6c0379d Oct 10, 2016

@jamesmcclain jamesmcclain force-pushed the jamesmcclain:feature/histogram-equalization branch from 6c0379d to 65f69ba Oct 18, 2016

@jamesmcclain

This comment has been minimized.

Member

jamesmcclain commented Oct 18, 2016

I have updated the PR comment with some pictures demonstrating the functionality on a multiband (non-landsat) image.

@jamesmcclain jamesmcclain force-pushed the jamesmcclain:feature/histogram-equalization branch 2 times, most recently from 438743a to df5c637 Oct 18, 2016

@jamesmcclain

This comment has been minimized.

Member

jamesmcclain commented Oct 19, 2016

The restriction to StreamingHistogram has been removed; I believe that all comments prior to this one have been addressed.

@lossyrob

This comment has been minimized.

Member

lossyrob commented Oct 19, 2016

@jamesmcclain good stuff. Can you update to master?

@lossyrob lossyrob added this to the 1.0 milestone Oct 19, 2016

@jamesmcclain jamesmcclain force-pushed the jamesmcclain:feature/histogram-equalization branch from df5c637 to 641da7f Oct 19, 2016

@jamesmcclain jamesmcclain force-pushed the jamesmcclain:feature/histogram-equalization branch from 641da7f to 2dc4e4d Oct 19, 2016

@jamesmcclain jamesmcclain referenced this pull request Oct 20, 2016

Merged

Sigmoidal Contrast #1681

3 of 3 tasks complete

@lossyrob lossyrob merged commit 63bb798 into locationtech:master Oct 20, 2016

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details

@jamesmcclain jamesmcclain deleted the jamesmcclain:feature/histogram-equalization branch Oct 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment