I have a hundreds of images that look like:
I need to be able to reliably and robustly find the centroid of the white square based on location of its peak intensity. However, the presence of the scale bar complicated thing.
I thought that fitting Gaussians to equally spaced vertical profiles, taken between the scale bar notches would be a good start. E.g:
a straight fit did not produce a good fit:
Excluding the following (xData <= 240) | (yData < 100) did result in a better fit: