1. A method of operating a charged particle microscope, the method comprising: providing settings of a focus, an x-stigmator and an y-stigmator of the charged particle microscope; and then repeatedly performing adjusting the charged particle microscope to the settings, recording an image of an object using the settings, determining a sharpness measure of the image as a whole from the recorded image, the sharpness measure indicating an overall sharpness of the recorded image, and changing at least one of the settings of the focus, the x-stigmator and the y stigmator based on the sharpness measure until a stop criterion is fulfilled; wherein the determining of the sharpness measure comprises: determining an orientation of an intensity gradient at each of a plurality of locations within one of the recorded image and a processed image generated by processing the recorded image, and determining the sharpness measure based on the plurality of determined orientations.