JohnDMcMaster / faxitron

Faxitron DX-50 x-ray utilities
21 stars 8 forks source link

Review histogram equalization #7

Closed JohnDMcMaster closed 4 years ago

JohnDMcMaster commented 4 years ago

Observation: when bad pixel replace is enabled on a mostly white image, the resulting equalized image is basically white. I suspect this is due to a hot pixel throwing off the dynamic range, but should confirm (maybe related to the corner issue)

When I use ImageMagick's dynamic algorithm (mine is not) it produces good images though. Ex: convert 2019-12-27_23_1.png ( +clone -equalize ) -average 2019-12-27_23_1_ei.png

Also consider switching to ImageMagick entirely if it produces nicer images in general

2019-12-27_23_1_e Above: no BPR, faxitron equalization

2019-12-27_23_1_ei Above: no BPR, ImageMagick equalization

2019-12-27_23_bpr_e Above: BPR, faxitron equalization

2019-12-27_23_bpr_ei Above: BPR, ImageMagick equalization

JohnDMcMaster commented 4 years ago

24bb001 adds some experimental modes. Notably "export FAXITRON_EQ_MODE=convert" will use ImageMagick. Default (0) is still old mode

JohnDMcMaster commented 4 years ago

There are two issues: -Faulty bad pixel replacement which was skewing the histogram. This is fixed: https://github.com/JohnDMcMaster/faxitron/issues/6 -We are using conventional histogram equalization

So the official resolution for now is: -Correct your images properly to make sure there aren't bad pixels -If you still get poor results, consider using dynamic histogram equalization (such as by FAXITRON_EQ_MODE=convert)