Adaptive Gamma Correction for Brightness-Distorted Images with \Imagick and PHP

I’m currently looking for a way to auto-gamma-correct / enhance my photos. In the end I wrote implementations for some papers – Here’s the second which might be understood as followup to the AGCWD from my previous Post. The paper’s title is » Contrast Enhancement of Brightness-Distorted Images by Improved Adaptive Gamma Correction « [1] and it basically enhances the AGCWD [2].
Continue Reading

the state pattern

The state pattern becomes useful if your object needs to react differently to different states. Let us assume you are writing an SMTP Proxy. SMTP works in sequences (connection establishment, ehlo/helo, mail, rcpt, data(, …), quit). Each sequence can have different error/success codes which are not available in another. For example you would only return 220 on connection establishment, not 250. And you would return 221 on quit, not 250. So if you are writing a server which works like this, you will most likely use an if then else or switch. The state-pattern would be another method to solve this. However, a more simple example which shows the pros and cons of the state pattern is an activity-based-sleep.
Continue Reading