An image processing device for detection and correction of a cloud cover in a multispectral input image, comprising: a cloud spectrum selection means for selecting at least one spectrum for each of pixels from spectra of one or more clouds present in the input image; an endmember extraction means (14; 14a) for extracting spectra of one or more endmembers other than the one or more clouds from those of the input image; an unmixing means for deriving fractional abundances of the respective spectra of the one or more endmembers and a selected spectrum of one of the one or more clouds for each of the pixels in the input image; and a probable cloud area detection means for detecting a probable cloud cover in the input image, wherein the endmember extraction means (14; 14a) is configured to extract the one or more endmembers from an area which is not detected as the probable cloud area; the image processing device further comprising: a cloud spectrum extraction means (31; 31a) for extracting at least one of the spectra of the one or more clouds present in the input image from the input image, wherein the cloud spectrum selection means is configured to select at least one spectrum from cloud spectra, the cloud spectra being one of the spectra of the one or more clouds extracted, wherein the cloud spectra extraction means is configured to extract the cloud spectra present in the input image by: deriving a histogram of a Gray-Level Co-occurrence Matrix, GLCM, mean image of the input image only for the probable cloud area, detecting peaks in the histogram, forming clusters of the one or more clouds present in the input image based on the peaks in the histogram of the GLCM mean of the probable cloud area, and deriving the spectra of the one or more clouds present in the input image as a set of representative spectra, each of which is obtained from each of the clusters. a cloud spectrum selection means for selecting at least one spectrum for each of pixels from spectra of one or more clouds present in the input image; an endmember extraction means (14; 14a) for extracting spectra of one or more endmembers other than the one or more clouds from those of the input image; an unmixing means for deriving fractional abundances of the respective spectra of the one or more endmembers and a selected spectrum of one of the one or more clouds for each of the pixels in the input image; and a probable cloud area detection means for detecting a probable cloud cover in the input image, wherein the endmember extraction means (14; 14a) is configured to extract the one or more endmembers from an area which is not detected as the probable cloud area; the image processing device further comprising: a cloud spectrum extraction means (31; 31a) for extracting at least one of the spectra of the one or more clouds present in the input image from the input image, wherein the cloud spectrum selection means is configured to select at least one spectrum from cloud spectra, the cloud spectra being one of the spectra of the one or more clouds extracted, wherein the cloud spectra extraction means is configured to extract the cloud spectra present in the input image by: deriving a histogram of a Gray-Level Co-occurrence Matrix, GLCM, mean image of the input image only for the probable cloud area, detecting peaks in the histogram, forming clusters of the one or more clouds present in the input image based on the peaks in the histogram of the GLCM mean of the probable cloud area, and deriving the spectra of the one or more clouds present in the input image as a set of representative spectra, each of which is obtained from each of the clusters. deriving a histogram of a Gray-Level Co-occurrence Matrix, GLCM, mean image of the input image only for the probable cloud area, detecting peaks in the histogram, forming clusters of the one or more clouds present in the input image based on the peaks in the histogram of the GLCM mean of the probable cloud area, and deriving the spectra of the one or more clouds present in the input image as a set of representative spectra, each of which is obtained from each of the clusters.