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

Correction for color blue in LDFC spectrograms #274

Closed
towsey opened this issue Nov 24, 2019 · 2 comments · Fixed by #275
Closed

Correction for color blue in LDFC spectrograms #274

towsey opened this issue Nov 24, 2019 · 2 comments · Fixed by #275
Assignees
Labels

Comments

@towsey
Copy link
Contributor

towsey commented Nov 24, 2019

Describe the bug

The drawing of LDFC spectrograms currently contains a colour blue correction because the blue in an LDFC spectrogram is not as "visible" or as "intense" as the red and the green. The correction occurs in the method < public static Image DrawRgbColourMatrix(double[,] redM, double[,] grnM, double[,] bluM, bool doReverseColour) > in the class LDSpectrogramRGB.cs, line 921 (as of 24/11/2019).

Expected behavior

The colour correction was intended to enhance the blue colour when the red and green indices both had low values (< 0.1). THis was done by adding additional green to create a "more visible" cyan colour. The correction was ad-hoc, i.e. "a hack".

Diagnostics

Anthony has demonstrated that the current colour correction produces a cyan halo around some "blue" acoustic events which is clearly artefactual and not consistent with what can be seen in the grey scale spectrograms.

Instructions

I am intending to change the colour correction in the hope that it will produce a more sensible colour effect.

Screenshots

Anthony has an LDFC spectrogram showing the problem.

Additional Details

towsey added a commit that referenced this issue Nov 24, 2019
Issue #274 Refactor code for correcting blue colour in LDFC spectrograms.
towsey added a commit that referenced this issue Nov 24, 2019
Issue #274 Adjusted display of EVN and CVR both of which are rendered in blue. Toned down the blue.
@atruskie atruskie added the bug label Nov 25, 2019
@atruskie
Copy link
Member

@towsey
Copy link
Contributor Author

towsey commented Nov 25, 2019

Concerning the following comment from Anthony: I have been doing some reading on colour spaces and have decided that to do it properly would take more effort than I have the time. I have reduced the effect of the "correction". I do not have the ability to test on a range of images where the "correction" can be stress tested. I have also changed the normalisation constants for EVN and CVR which are typically rendered in blue.

Anthony's comment:
We should avoid applying this effect based on on a threshold. We'd suggest some kind of curve be applied to the blue channel to boost it.

Additionally, if you want to boost saturation or brightness you definitely need to use an HSL or HSV model. The RGB colour space is not linear and simple manipulations of it will always produce sub-optimal results.

The ImageSharp library (already references) has HSL, HSV and YCbCr colour space structures we can use to manipulate these colours: https://github.com/SixLabors/ImageSharp/tree/master/src/ImageSharp/ColorSpaces

towsey added a commit that referenced this issue Dec 4, 2019
Issue #274 Made correction of blue colour an optional parameter in the LDSpectorgramConfig file.
Some Resharper motivated changes.
towsey added a commit that referenced this issue Dec 4, 2019
Issue #274 Fix unit tests for Drawing flase-colour spectrograms. Changes needed due to addition of blue color parameter.
towsey added a commit that referenced this issue Jan 31, 2020
Issue #274 Correction for blue colour in LDFC spectrograms
towsey added a commit that referenced this issue Feb 7, 2020
Issue #274/275 Changed the expected result for a pixel colour due to one small cahnge in code. The test should now pass. however, the test could not be run due to SixLabors compile problems.
atruskie added a commit that referenced this issue Feb 9, 2020
…orrection-Issue-#274

Ldfc spectrogram color correction issue #274
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants