Strange situation, and probably nothing to worry about. But myself and a friend were looking out of our window at our accommodation in Rome at night (we're not staying in the best of areas), and there was a stranger staring at us for a few minutes. He then took a photo of us and walked away. Is this something we should worry about? We are not from Rome.
Probably not. Rome itself is highly photographic. The two of you leaning out a window likely competed the scene/composition of the photo.
Individual was probably considering taking the photo.
I once saw 2 tourists in Garbatella neighbourhood blatantly taking pictures inside a home (ground floor) where there was an old man! They were girls and he was a man, if it was the opposite everyone would have talked about sexual harassment. I told him in Italian to close the window, it was a surrealistic situation. This just to say that there are tourists who know no boundaries if they think the perspective is instagrammable enough
Tourists photographing other tourists. Overtourism central. 🤷♂️
Probs just a street photographer. They're everywhere here.