Transformation of color representations and spectral recovery
A system comprising at least one hardware processor; and a non-transitory computer-readable storage medium having stored thereon program instructions, the program instructions executable by the at least one hardware processor to: receive a set of spectral datapoints obtained from a plurality of images of natural scenes, wherein the images are captured using a hyperspectral imaging device, perform data sampling to obtain a subset of the set of spectral datapoints that is representative of naturally-occurring spectral samples, and said subset of datapoints over (i) a known spectral response profile of a source color space, and (ii) a known spectral response profile of a target color space, to obtain corresponding datasets of source spectral reference atoms and target spectral reference atoms.
1 . A system comprising:
at least one hardware processor; and
a non-transitory computer-readable storage medium having stored thereon program instructions, the program instructions executable by the at least one hardware processor to:
receive a set of spectral datapoints obtained from a plurality of images of natural scenes, wherein the images are captured using a hyperspectral imaging device,
perform data sampling to obtain a subset of said set of spectral datapoints that is representative of naturally-occurring spectral samples,
project said subset of datapoints over (i) a known spectral response profile of a source color space, and (ii) a known spectral response profile of a target color space, to obtain corresponding datasets of source spectral reference atoms and target spectral reference atoms, and
for each point in said source color space: (a) identify the k nearest atoms in said dataset of source spectral reference atoms; and (b) calculate and store a transform associated with said point from said k nearest atoms in said dataset of source spectral reference atoms to a set of corresponding k atoms in said dataset of target spectral reference atoms.
2 . The system of claim 1 , wherein said program instructions are further executable to receive a digital image in said source color space and, iteratively:
(i) with respect to a first pixel in said digital image, locate a point which represents said pixel within said source color space;
(ii) recall said stored transform calculated with respect to said located point in said source color space;
(iii) apply said recalled transform to said pixel, to obtain a target pixel in said target color space;
(iv) repeat steps (i)-(iii) with respect to a next pixel in said digital image; and
construct a target image in said target color space from all of said obtained target pixels in said target color space.
3 . The system of claim 1 , wherein said transform is a linear transform which maps values between said source color space and said target color space.
4 . The system of claim 1 , wherein said transform is calculated as a weighted interpolation, by applying a weighting to each of said k nearest atoms in said dataset of source spectral reference atoms, and wherein said weighting is the inverse of the distance of each of said k nearest atoms to said point in said source color space representing said pixel.
5 . The system of claim 1 , wherein said source color space is cyan-yellow-magenta (CYM), and said target color space is red-green-blue (RGB).
6 . The system of claim 1 , wherein said natural scenes comprise one or more of: indoors scenes, outdoors scenes, cityscape scenes, countryside scenes, landscape scenes, landforms scenes, terrain scenes, wildlife scenes, vegetation scenes, and objects scenes.
7 . A computer-implemented method comprising:
receiving a set of spectral datapoints obtained from a plurality of images of natural scenes, wherein the images are captured using a hyperspectral imaging device;
performing data sampling to obtain a subset of said set of spectral datapoints that is representative of naturally-occurring spectral samples;
projecting said subset of datapoints over (i) a known spectral response profile of a source color space, and (ii) a known spectral response profile of a target color space, to obtain corresponding datasets of source spectral reference atoms and target spectral reference atoms; and
for each point in said source color space: (a) identifying the k nearest atoms in said dataset of source spectral reference atoms; and (b) calculating and storing a transform associated with said point from said k nearest atoms in said dataset of source spectral reference atoms to a set of corresponding k atoms in said dataset of target spectral reference atoms.
8 . The computer-implemented method of claim 7 , further comprising receiving a digital image in said source color space and, iteratively:
(i) with respect to a first pixel in said digital image, locating a point which represents said pixel within said source color space;
(ii) recalling said stored transform calculated with respect to said located point in said source color space;
(iii) applying said recalled transform to said pixel, to obtain a target pixel in said target color space;
(iv) repeating steps (i)-(iii) with respect to a next pixel in said digital image; and
constructing a target image in said target color space from all of said obtained target pixels in said target color space.
9 . The computer-implemented method of claim 7 , wherein said transform is a linear transform which maps values between said source color space and said target color space.
10 . The computer-implemented method of claim 7 , wherein said transform is calculated as a weighted interpolation, by applying a weighting to each of said k nearest atoms in said dataset of source spectral reference atoms, and wherein said weighting is the inverse of the distance of each of said k nearest atoms to said point in said source color space.
11 . The computer-implemented method of claim 7 , wherein said source color space is cyan-yellow-magenta (CYM), and said target color space is red-green-blue (RGB).
12 . The computer-implemented method of claim 7 , wherein said natural scenes comprise one or more of indoors scenes, outdoors scenes, cityscape scenes, countryside scenes, landscape scenes, landforms scenes, terrain scenes, wildlife scenes, vegetation scenes, and objects scenes.
13 . A computer program product comprising a non-transitory computer-readable storage medium having program instructions embodied therewith, the program instructions executable by at least one hardware processor to:
receive a set of spectral datapoints obtained from a plurality of images of natural scenes, wherein the images are captured using a hyperspectral imaging device;
perform data sampling to obtain a subset of said set of spectral datapoints that is representative of naturally-occurring spectral samples;
project said subset of datapoints over (i) a known spectral response profile of a source color space, and (ii) a known spectral response profile of a target color space, to obtain corresponding datasets of source spectral reference atoms and target spectral reference atoms; and
for each point in said source color space: (a) identify the k nearest atoms in said dataset of source spectral reference atoms; and (b) calculate and store a transform associated with said point from said k nearest atoms in said dataset of source spectral reference atoms to a set of corresponding k atoms in said dataset of target spectral reference atoms.
14 . The computer program product of claim 13 , wherein said program instructions are further executable to receive a digital image in said source color space and, iteratively:
(i) with respect to a first pixel in said digital image, locate a point which represents said pixel within said source color space;
(ii) recall said stored transform calculated with respect to said located point in said source color space;
(iii) apply said recalled transform to said pixel, to obtain a target pixel in said target color space;
(iv) repeat steps (i)-(iii) with respect to a next pixel in said digital image; and
construct a target image in said target color space from all of said obtained target pixels in said target color space.