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

Fix display of Debug spectrograms and write unit tests #300

Closed
towsey opened this issue Mar 3, 2020 · 4 comments
Closed

Fix display of Debug spectrograms and write unit tests #300

towsey opened this issue Mar 3, 2020 · 4 comments

Comments

@towsey
Copy link
Contributor

towsey commented Mar 3, 2020

Describe the bug

The drawing of debug spectrograms, in particular the display of score tracks and the overlay of matrix scores, is yet to be properly checked. Need to write unit tests for these.

The overlay of score matrices on standard scale spectrograms has not been checked for some time.
This work needs to be done in order to facilitate the writing of new generic recognizers as in Issue #297.

@atruskie
Copy link
Member

atruskie commented Mar 3, 2020

Can you show the visual errors here, please?

towsey added a commit that referenced this issue Mar 5, 2020
Issue #300
Write one unit test for overlay of sonogram with matrix of score/hits.
Remove duplicated method RecognizerBase.WriteSpectrumIndicesFiles()
Rewrite method for drawing of event rectangles.
towsey added a commit that referenced this issue Mar 6, 2020
Issue #300 Unit tests for drawing events on sonograms
Make unit test for drawing a matrix of scores over a spectrogram.
Shift unit test EventStatisticsCalculateTests to a new namespace of tests for acoustic events.
Create new class of tests for acoustic events.
towsey added a commit that referenced this issue Mar 6, 2020
Issue #300 The main difficulty here is confusing terminology of temporal  fileds and properties. Changed some of these to be more explicit.
There appears to remain one more bug - the number of acoustic events in the ae.csv file does not match number that appears in the spectrogram images??
towsey added a commit that referenced this issue Mar 6, 2020
towsey added a commit that referenced this issue Mar 7, 2020
Issue #300 Final debug of merge events.
It now works correctly.
towsey added a commit that referenced this issue Mar 10, 2020
Issue #300 Removed unneccesary methods and added documentation.
Grouped methods according to functionality.
towsey added a commit that referenced this issue Mar 10, 2020
Issue #300 Most of the changes are to terminology of temporal variables.
Also to signatures of test methods.
towsey added a commit that referenced this issue Mar 19, 2020
Issue #300 Fix anti-aliasing problem and then fix unit tests for the drawing of events.
@atruskie
Copy link
Member

atruskie commented Mar 20, 2020

Ok, some of this work has been done in #301.

More remains.

Text Anti-Aliasing

Compare old image vs new:

old

image

image

new

image

image

issues

  • the anti-aliasing on the text is the new one is way too aggressive
  • the quality of ImageSharp anti-aliasing seems sub-par
  • the font seems to generally be smaller (DPI issue?).
    • Dimensions of the zero in Y scale is 6x9 in old, and 4x7 in new)
    • Dimensions of the W in Whistle are 7x6 in old and 5x5 in new
    • Title E in title bar seems to be 8x9 in old and 5x7 in new
  • rectangle axes segments need to be updated to be non-AA
  • horizontal divider needs to be updated to be non-AA
  • the rectangle is missing a pixel in lower right corner

@towsey - can you please precisely identify and changes you've made to the fonts/sizes of the text in question between the conversion and this point - I don't want to attribute behaviour to changes that are yours and not a bug.

@towsey - you should continue your work on the recognisers despite these image imperfections. We'll fix them up as we go and the images will progressively get better.

towsey added a commit that referenced this issue Mar 20, 2020
Issue #300 Fixed test of drawing events on spectrograms. Test now uses the new image comparison facility.
Set the event name to empty string in order to prevent test failing due to writing of poorly anti-aliased text.
Returned font type to the original.
Included new expected events image in Fixtures.
@atruskie
Copy link
Member

Note: an asset committed in 04f9b04 (https://github.com/QutEcoacoustics/audio-analysis/blob/04f9b044e4c0e281a6a681580bdd46c223be7037/tests/Fixtures/EventTests_SuperimposeEventsOnImage.png) is actually reflective of the bug described in this issue and will need to be adjusted when this is fixed.

atruskie pushed a commit that referenced this issue Mar 20, 2020
Issue #300
Write one unit test for overlay of sonogram with matrix of score/hits.
Remove duplicated method RecognizerBase.WriteSpectrumIndicesFiles()
Rewrite method for drawing of event rectangles.
atruskie pushed a commit that referenced this issue Mar 20, 2020
Issue #300 Unit tests for drawing events on sonograms
Make unit test for drawing a matrix of scores over a spectrogram.
Shift unit test EventStatisticsCalculateTests to a new namespace of tests for acoustic events.
Create new class of tests for acoustic events.
atruskie pushed a commit that referenced this issue Mar 20, 2020
Issue #300 The main difficulty here is confusing terminology of temporal  fileds and properties. Changed some of these to be more explicit.
There appears to remain one more bug - the number of acoustic events in the ae.csv file does not match number that appears in the spectrogram images??
atruskie pushed a commit that referenced this issue Mar 20, 2020
atruskie pushed a commit that referenced this issue Mar 20, 2020
Issue #300 Final debug of merge events.
It now works correctly.
atruskie pushed a commit that referenced this issue Mar 20, 2020
Issue #300 Removed unneccesary methods and added documentation.
Grouped methods according to functionality.
atruskie pushed a commit that referenced this issue Mar 20, 2020
Issue #300 Most of the changes are to terminology of temporal variables.
Also to signatures of test methods.
atruskie pushed a commit that referenced this issue Mar 20, 2020
Issue #300 Fix anti-aliasing problem and then fix unit tests for the drawing of events.
atruskie pushed a commit that referenced this issue Mar 20, 2020
Issue #300 Fixed test of drawing events on spectrograms. Test now uses the new image comparison facility.
Set the event name to empty string in order to prevent test failing due to writing of poorly anti-aliased text.
Returned font type to the original.
Included new expected events image in Fixtures.
@atruskie
Copy link
Member

I think most of the issues highlighted here have been dealt with - except for the antialiasing.

Opening that in a new issue for easier tracking. See #449

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

No branches or pull requests

2 participants