C implementation of avoid green (with numpy array/image)