An important factor which affects performance of solar adaptive optics (AO) systems is the accuracy of tracking an extended object in the wavefront sensor. The accuracy of a centre-of-mass approach to image shift measurement depends on the parameters applied in thresholding the recorded image; however, there exists no analytical prediction for these parameters for extended objects. Motivated by this we present a new method for exploring the parameter space of image shift measurement algorithms, and apply this to optimize the parameters of the algorithm. Using a thresholded, windowed centre of mass, we are able to improve centroid accuracy compared to the typical parabolic fitting approach by a factor of 3 in a signal-to-noise regime typical for solar AO. Exploration of the parameters occurs after initial image cross-correlation with a reference image, so does not require regeneration of correlation images. The results presented employ methods which can be used in real-time to estimate the error on centroids, allowing the system to use real data to optimize parameters, without needing to enter a separate calibration mode. This method can also be applied outside of solar AO to any field which requires the tracking of an extended object.