His eminence, Sheikh Salim Hisham, member of league of scholars of the West says:

‘The prophet, may Allah’s peace and blessings be upon him says in an Hadith transmitted by Nu’maan ibn Basheer in an Authentic narration of Imam Bukhari: “Indeed, what is lawful is clear and what is unlawful is explicit but in-between them are matters that are doubtful (not clear)”. This unlawful that is clear is divided into two parts: what connects a servant and his creator, and what connects a servant and his brother( in religion). 

Then, Allah’s right is requiring renunciation of sins and remorsefulness on your mistakes, and increase in good deeds. As the Most High says: ‘Verily, good deeds clear off bad deeds’.

But people’s rights to this topic are more than three: Making amendments. When a person sees the private part (that is covered) of another person, such has committed two sins; sìn of going against the command of Allah, of which looking at forbidden things is condemned. In His Word(Qur’ān), Suratul Nur where He, the most high, says: Tell the believing men to lower their gaze and guard their private parts. That is purer for them. Indeed, Allah is Acquainted with what they do. [Quran 24 : 30 ]

The second sin is that he has compromised the privacy of the brother and discovered his nakedness in a spying manner. If possible, it is necessary to repent from looking at the forbidden. Subsequently, the person should be told if notifying him will not unlock something greater than that, which is a recurrence of animosity between the two parties. But if not, it will be enough to be confined to only repentance between him (the perpetrator) and the Almighty.