lux's code for blob detection