1. An electronic device, comprising: imaging hardware; a storage medium including a set of instructions; and a processor in communication with the storage medium and the imaging hardware, wherein when executing the set of instructions, the processor is configured to direct the electronic device to: obtain, from the imaging hardware, a first plurality of frames of preview images of a scene, each frame associated with a character distance of a plurality of character distances of the electronic device; for each of the first plurality of frames of preview images, determine at least one target image area, wherein each of the at least one target image area comprises an image area on which an object in the scene is sharply focused; and set a focus area according to the at least one target image area; generate, from the imaging hardware, a second plurality of frames of images of the scene, each frame based on fine-focusing on the corresponding focus area and corresponding character distance; and generate an all-focused image comprising a matrix of target pixels from the second plurality of frames of images, wherein to generate the all-focused image, the processor is configured to direct the device to, for each target pixel: in response to identifying that one or more frames of images among the second plurality of frames of images each includes a target image area that contains a pixel corresponding to the target pixel, determine a value of the target pixel according to pixel values of pixels in the identified one or more frames of images corresponding to the target pixel; and in response to determining that the second plurality of frames of images do not include a frame having a target image area that includes a pixel corresponding to the target pixel, determine a value of the target pixel according to pixel values of pixels in the second plurality of frames of images corresponding to the target pixel.