Method for correcting a spectrum of an ionizing electromagnetic radiation transmitted by an object, - the object being arranged between an irradiation source and a detector, the irradiation source being able to emit an ionizing electromagnetic radiation, called incident radiation (I 0), towards said object; - the detector comprising pixels (20 i,j), each pixel configured to detect a radiation transmitted by the object towards the detector, and to acquire a spectrum ( S i,j) therefrom, the transmitted radiation comprising a scattering radiation ( I diff), caused by the scattering of the incident radiation in the object, and a primary radiation ( I p); the method comprising the following steps: a) interposing a mask between the source and the object, and acquiring, by several pixels (20 i,j), a first spectrum S i, j 1 of a first radiation (I 1) transmitted by the object, said mask comprising attenuating elements (15 x), able to attenuate a part of said incident radiation (I 0), and of which a projection on the detector defines a first group of pixels ( G 1); b) obtaining, for each pixel of the first group of pixels ( G 1), a second spectrum S i, j ∈ G 1 2 of a second radiation (I 2) transmitted by the object to the detector, in the absence of said mask; c) comparing, for each pixel of said first group of pixels ( G 1), the first spectrum S i, j ∈ G 1 1 and the second spectrum S i, j ∈ G 1 2, so as to obtain a comparison spectrum (Δ S i,j ∈G 1); d) for each pixel of the first group of pixels ( G 1), applying a transition matrix, previously established, to said comparison spectrum (Δ S i,j ∈ G 1), to obtain an estimation of a so-called primary spectrum S ^ i, j ∈ G 1 2 p representing the primary radiation transmitted by the object to said pixel, and estimating a scattering spectrum S ̃ i, j ∈ G 1 diff, representative of the scattering radiation transmitted by the object; e) for all or some of the pixels (20 i,j) of the detector, from each scattering spectrum S ̃ i, j ∈ G 1 diff estimated in the step d), correcting the second spectrum S i, j 2 or the first spectrum S i, j 2 so as to obtain a corrected spectrum S i, j *. - the object being arranged between an irradiation source and a detector, the irradiation source being able to emit an ionizing electromagnetic radiation, called incident radiation (I 0), towards said object; - the detector comprising pixels (20 i,j), each pixel configured to detect a radiation transmitted by the object towards the detector, and to acquire a spectrum ( S i,j) therefrom, the transmitted radiation comprising a scattering radiation ( I diff), caused by the scattering of the incident radiation in the object, and a primary radiation ( I p); a) interposing a mask between the source and the object, and acquiring, by several pixels (20 i,j), a first spectrum S i, j 1 of a first radiation (I 1) transmitted by the object, said mask comprising attenuating elements (15 x), able to attenuate a part of said incident radiation (I 0), and of which a projection on the detector defines a first group of pixels ( G 1); b) obtaining, for each pixel of the first group of pixels ( G 1), a second spectrum S i, j ∈ G 1 2 of a second radiation (I 2) transmitted by the object to the detector, in the absence of said mask; c) comparing, for each pixel of said first group of pixels ( G 1), the first spectrum S i, j ∈ G 1 1 and the second spectrum S i, j ∈ G 1 2, so as to obtain a comparison spectrum (Δ S i,j ∈G 1); d) for each pixel of the first group of pixels ( G 1), applying a transition matrix, previously established, to said comparison spectrum (Δ S i,j ∈ G 1), to obtain an estimation of a so-called primary spectrum S ^ i, j ∈ G 1 2 p representing the primary radiation transmitted by the object to said pixel, and estimating a scattering spectrum S ̃ i, j ∈ G 1 diff, representative of the scattering radiation transmitted by the object; e) for all or some of the pixels (20 i,j) of the detector, from each scattering spectrum S ̃ i, j ∈ G 1 diff estimated in the step d), correcting the second spectrum S i, j 2 or the first spectrum S i, j 2 so as to obtain a corrected spectrum S i, j *.