1. A computer-implemented method for a gesture-based user interface for controlling a software program on an electronic device, said method comprising: receiving image data from a multi-aperture image sensor in said electronic device, said image sensor being configured to simultaneously expose an image sensor to at least a first part of the electromagnetic (EM) spectrum using a first aperture and at least a second part of the EM spectrum using one or more second apertures; determining sharpness information in at least one area of said image data associated with at least part of an object imaged by said first aperture and said one or more second apertures onto the image plane of said image sensor; generating depth information on the basis of at least part of said sharpness information; and, recognizing on the basis of said depth information, at least part of a gesture associated with a movement of said object.