1. An electronic device equipped with a video imaging process capability, which device includes a camera unit arranged to produce image frames from an imaging view which includes a region-of-interest ROI, an adjustable optics arranged in connection with the camera unit in order to focus the ROI on the camera unit, an identifier unit in order to identify a ROI from the image frame, a tracking unit in order to track the ROI from the image frames during the video imaging process, an auto-focus unit arranged to analyze the ROI on the basis of the tracking results provided by the tracking unit in order to adjust the optics and the device being arranged to determine the spatial position of the ROI along the Z-axis in order to detect the movement of the ROI in depth of the imaging view, determine the spatial position of the ROI from the produced image frames, determine the Z-axis position of the ROI from a change in the size of the ROI between produced consecutive image frames, and adjust the optics on the basis of the determination in an established manner.