# Enter a commit message. # # Changes: # # kstars/fitsviewer/fitshistogram.cpp
ClosedPublic

Authored by murveit on Sep 18 2019, 7:31 AM.

Details

Summary

Improve the accuracy of the median calculation in fitshistogram.cpp

Previously, the median calculation used a histogram algorithm to find a range that contained the
median value, and chose the median as the center of that range. With this revision, the frequencies
of all samples in the range are calculated, and the exact median can be computed (subject to some
downsampling of the data).

Diff Detail

Repository
R321 KStars
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
murveit created this revision.Sep 18 2019, 7:31 AM
Restricted Application added a project: KDE Edu. · View Herald TranscriptSep 18 2019, 7:31 AM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
murveit requested review of this revision.Sep 18 2019, 7:31 AM
murveit updated this revision to Diff 66359.Sep 18 2019, 8:00 AM
  1. Updating D24041: # Enter a commit message. # # Changes: # # kstars/fitsviewer/fitshistogram.cpp #
  2. Enter a brief description of the changes included in this update.
  3. The first line is used as subject, next lines as comment. #
  4. If you intended to create a new revision, use:
  5. $ arc diff --create

No substantive changes. I removed the tabs from the file.

mutlaqja accepted this revision.Sep 18 2019, 8:31 AM

Great work, thanks!

There is an issue now in the FITS viewer where the median is displayed as zero, but this is another issue I will look at now.

This revision is now accepted and ready to land.Sep 18 2019, 8:31 AM
This revision was automatically updated to reflect the committed changes.

So it looks like with a debayered image (like the one I sent you in the email) generate bogus results. Can you check why?

Jasem,

When I look at the image you sent me, either in Pixinsight or Fitsviewer, it seems like it's a 1-channel image (I assume it's not debayered--it has seems to look like a bayer pattern).
That is, it doesn't seem to display as a color image before or after my change.
Does it work differently for you?
Please send instructions on how to test this image, or please send me an image that would display with color (or show 3 medians for R, G & B) on the original software.

Thanks,
Hy