-
Notifications
You must be signed in to change notification settings - Fork 361
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
Histogram Equalization #1668
Conversation
0fa772a
to
e3c3fce
Compare
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 = |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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. |
e3c3fce
to
6c0379d
Compare
6c0379d
to
65f69ba
Compare
I have updated the PR comment with some pictures demonstrating the functionality on a multiband (non-landsat) image. |
438743a
to
df5c637
Compare
The restriction to |
@jamesmcclain good stuff. Can you update to master? |
df5c637
to
641da7f
Compare
The various histogram equalization functionality had previously been tied to StreamingHistogram, now it works with Histogram[T].
641da7f
to
2dc4e4d
Compare
Still Needs:
Singleband
Unequalized:
Equalized (signed values being treated as unsigned by GIMP):
Equalized (signed values being treated as signed by GeoServer):
Multiband
Original:
GIMP histogram equalization (Colors -> Auto -> Equalize)
Histogram equalization using this PR
Original bands:
Equalized bands (using this PR):