Skip to content
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

Conversation

jamesmcclain
Copy link
Member

@jamesmcclain jamesmcclain commented Oct 9, 2016

Still Needs:

  • Fix GeoWave Tests #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 feature/histogram-equalization branch 2 times, most recently from 0fa772a to e3c3fce Compare October 10, 2016 14:10
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 =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, will-do.



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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

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 feature/histogram-equalization branch from e3c3fce to 6c0379d Compare October 10, 2016 23:10
@jamesmcclain jamesmcclain force-pushed the feature/histogram-equalization branch from 6c0379d to 65f69ba Compare October 18, 2016 18:25
@jamesmcclain
Copy link
Member Author

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

@jamesmcclain jamesmcclain force-pushed the feature/histogram-equalization branch 2 times, most recently from 438743a to df5c637 Compare October 19, 2016 01:53
@jamesmcclain
Copy link
Member Author

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

@lossyrob
Copy link
Member

@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 feature/histogram-equalization branch from df5c637 to 641da7f Compare October 19, 2016 13:01
@jamesmcclain jamesmcclain force-pushed the feature/histogram-equalization branch from 641da7f to 2dc4e4d Compare October 19, 2016 13:11
@jamesmcclain jamesmcclain mentioned this pull request Oct 20, 2016
3 tasks
@lossyrob lossyrob merged commit 63bb798 into locationtech:master Oct 20, 2016
@jamesmcclain jamesmcclain deleted the feature/histogram-equalization branch October 20, 2016 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants