1. A method of handling overlay subpictures in stabilized images comprising: detecting an overlay subpicture in an input image; stabilizing the input image to form a stabilized image; and merging the overlay subpicture with the stabilized image to obtain an output image by: processing a region the overlay subpicture is located in, and setting the overlay subpicture separated from the input image on the stabilized image; wherein processing the region the overlay subpicture is located in comprises replacing the region the overlay subpicture is located in with image data from a second region of the stabilized image.