79768306

Date: 2025-09-18 10:38:44
Score: 0.5
Natty:
Report link

image is uint8, so the 1 + image happens in uint8 arithmetic. Therefore 256 becomes 0.

Also, that formula is different. This one reflects the original formula:

c = 255 / np.log(1 + np.max(image.astype(np.float32)))
log_transformed = c * np.log(1 + image.astype(np.float32))
log_transformed = np.clip(log_transformed, 0, 255).astype(np.uint8)
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: AcidResin