A device for time delay and integration imaging, said device comprising: an array of pixels being arranged in rows and columns forming an imaging array, the rows and columns extending in a first and second direction of the imaging array, respectively, wherein each pixel is configured to generate an electric charge proportional to intensity of electro-magnetic radiation incident on the pixel and wherein the pixels are configured to transfer generated charges in the second direction along each column of the imaging array for accumulating the generated charges in the pixels along each column; said rows of the imaging array comprising at least one lateral charge shifting row, which is configured to selectively shift charges at least partly in the first direction so as to selectively shift accumulated charges in a column to an adjacent column; and at least two measurement lines (56; 150) comprising measurement pixels (52; 152), which are configured to generate an electric charge proportional to intensity of electro-magnetic radiation incident on the measurement pixels (52; 152) and wherein the measurement pixels (52; 152) are configured to transfer generated charges along the corresponding measurement lines (56; 150) for accumulating the generated charges in the measurement pixels (52; 152) along the corresponding measurement lines (56; 150), wherein the at least two measurement lines (56; 150) comprising measurement pixels (52; 152) are separate from the imaging array; the device further comprising a controller, which is configured to receive at least two angle correction input values, wherein the at least two angle correction input values are based on a received intensity of electro-magnetic radiation acquired by the corresponding measurement lines (56; 150) extending in directions defining different angles in relation to the second direction, wherein the controller is configured to, based on the received at least two angle correction input values, determine a direction of change needed for aligning shifting of charges through the imaging array with a movement of the device in relation to a scene, wherein the controller is configured to determine a contrast of image information based on the at least two angle correction input values for determining the direction of change, and wherein the controller is configured to control activation or deactivation of the at least one lateral charge shifting row based on the determined direction of change. an array of pixels being arranged in rows and columns forming an imaging array, the rows and columns extending in a first and second direction of the imaging array, respectively, wherein each pixel is configured to generate an electric charge proportional to intensity of electro-magnetic radiation incident on the pixel and wherein the pixels are configured to transfer generated charges in the second direction along each column of the imaging array for accumulating the generated charges in the pixels along each column; said rows of the imaging array comprising at least one lateral charge shifting row, which is configured to selectively shift charges at least partly in the first direction so as to selectively shift accumulated charges in a column to an adjacent column; and at least two measurement lines (56; 150) comprising measurement pixels (52; 152), which are configured to generate an electric charge proportional to intensity of electro-magnetic radiation incident on the measurement pixels (52; 152) and wherein the measurement pixels (52; 152) are configured to transfer generated charges along the corresponding measurement lines (56; 150) for accumulating the generated charges in the measurement pixels (52; 152) along the corresponding measurement lines (56; 150), wherein the at least two measurement lines (56; 150) comprising measurement pixels (52; 152) are separate from the imaging array; the device further comprising a controller, which is configured to receive at least two angle correction input values, wherein the at least two angle correction input values are based on a received intensity of electro-magnetic radiation acquired by the corresponding measurement lines (56; 150) extending in directions defining different angles in relation to the second direction, wherein the controller is configured to, based on the received at least two angle correction input values, determine a direction of change needed for aligning shifting of charges through the imaging array with a movement of the device in relation to a scene, wherein the controller is configured to determine a contrast of image information based on the at least two angle correction input values for determining the direction of change, and wherein the controller is configured to control activation or deactivation of the at least one lateral charge shifting row based on the determined direction of change.