Photon-counting x-ray detectors (3) suffer from a degradation of their performance due to polarization. In order to correct the effects of polarization to the generated x-ray images, the invention suggests (i) exposing the radiation detector (3) to a first radiation pulse emitted by a further radiation source (11) and obtaining a first electric pulse signal generated by the radiation detector (3) in response thereto, (ii) later exposing the 5 radiation detector (3) to a second radiation pulse emitted by the further radiation source (11) during the acquisition of the image and obtaining a second electric pulse signal generated by the radiation detector (3) in response thereto, and (iii) comparing amplitudes of the first and second electric pulse signals and generating the x-ray image based on a result of the comparison. The invention provides a corresponding x-ray device and a corresponding method.