An optical system for a hyperspectral camera, where the optical system comprises: fore optics being an optical subsystem arranged for creating an image of a scene that is being depicted; an image sensor; a slit comprising a slit surface and a slit opening through the slit, the slit opening forming a stripe on the slit surface, where the stripe has a length along a centre of the stripe and a width across the stripe perpendicular to each point of the centre of the stripe, where the total length is at least an order of magnitude greater than the maximum width, where the slit is positioned where light from the fore optics is focused in a direction perpendicular to the slit opening; and the slit is arranged for blocking light from the scene with the exception of light passing through the slit opening, effectively cutting a narrow area out of the scene; relay optics comprising a dispersive element, the relay optics being an optical subsystem arranged for projecting an image of the narrow area of the scene onto the image sensor with light from the narrow scene being spectrally dispersed in a direction perpendicular to the tangent of the stripe; characterized in that the optical system further comprises: a first optical element positioned before the slit, the first optical element having a form that defocuses light in a direction parallel to the tangent of the stripe while keeping focus in a direction perpendicular to the tangent of the stripe; and a second optical element positioned after the slit, the second optical element compensating the defocus introduced by the first element. fore optics being an optical subsystem arranged for creating an image of a scene that is being depicted; an image sensor; a slit comprising a slit surface and a slit opening through the slit, the slit opening forming a stripe on the slit surface, where the stripe has a length along a centre of the stripe and a width across the stripe perpendicular to each point of the centre of the stripe, where the total length is at least an order of magnitude greater than the maximum width, where the slit is positioned where light from the fore optics is focused in a direction perpendicular to the slit opening; and the slit is arranged for blocking light from the scene with the exception of light passing through the slit opening, effectively cutting a narrow area out of the scene; relay optics comprising a dispersive element, the relay optics being an optical subsystem arranged for projecting an image of the narrow area of the scene onto the image sensor with light from the narrow scene being spectrally dispersed in a direction perpendicular to the tangent of the stripe; characterized in that the optical system further comprises: a first optical element positioned before the slit, the first optical element having a form that defocuses light in a direction parallel to the tangent of the stripe while keeping focus in a direction perpendicular to the tangent of the stripe; and a second optical element positioned after the slit, the second optical element compensating the defocus introduced by the first element. a first optical element positioned before the slit, the first optical element having a form that defocuses light in a direction parallel to the tangent of the stripe while keeping focus in a direction perpendicular to the tangent of the stripe; and a second optical element positioned after the slit, the second optical element compensating the defocus introduced by the first element.