What concise recipee is there to overlay objects on top of images, using relative coordinates (such as fraction of image width/height)?
For example trying to draw a red rectangle to highlight a specific region of this image:

\documentclass[a4paper]{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}{}
\begin{tikzpicture}
\node[inner sep=0, anchor=south west] (img) at (0,0) {
\includegraphics[keepaspectratio,height=.9\textheight,width=\linewidth]{refgrid_crop}%
};
\begin{scope}[x={(img.south west)},y={(img.south west)},local bounding box=img]
\draw[thick, rounded corners, color=red!80!black, anchor=south west] (0.5, 0.3)
rectangle (0.75, 0.5);
\end{scope}
\end{tikzpicture}
\end{frame}
\end{document}
The above code using scope does not display at all a rectangle at the wanted fractions 0.5, 0.3. Also, I don't understand why, but a rectangle only appears in the lower right region when I set the scope parameters x and y to {(img.south east)}, while expected this parameter to indicate the origin of the coordinate system...
How to switch the units to image fraction and origin to south-west ?

x=1mm, y=1inis a way to rescale the x-axis and y-axis, not a way to shift things. Shifting is done byshift={(x, y)}. – Symbol 1 Jul 28 '21 at 16:12calloutsmay help you out (but other solutions presented are very nice too). – SebGlav Jul 28 '21 at 17:06\begin{scope}[x={(img.south east)},y={(img.north west)}], not what you currently have. – Torbjørn T. Jul 28 '21 at 20:53xandyparameters rescale the axes, specifically they define the unit vectors. You've placed the image with the bottom left corner at(0,0), so if you setx=(img.south east), the x unit vector points from bottom left to the bottom right corner of the image. Similarly, withy=(img.north west), the y unit vector goes from the bottom left to the top left of the image. – Torbjørn T. Jul 28 '21 at 21:26