<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Recognition of small color differences with computer vision devices</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Irina G. Palchikova</string-name>
          <email>palchikova@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Evgenii S. Smirnov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Technological Design Institute of Scientific Instrument Engineering SB RAS</institution>
          ,
          <addr-line>Novosibirsk</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2008</year>
      </pub-date>
      <abstract>
        <p>It is experimentally shown that a digital atlas of monochromatic color stimuli with a controlled width of the spectrum can be constructed by using the monochromator. A method for testing the spectral sensitivity of the camera's RGB sensors and measuring its color gamut is presented. For detection and quantitative characterization of small color differences of the image elements, it is proposed to divide the objective analysis of the image into blocks of the color segmentation and the evaluation of the color tone and the color difference.</p>
      </abstract>
      <kwd-group>
        <kwd>digital image</kwd>
        <kwd>color</kwd>
        <kwd>dominant wavelength</kwd>
        <kwd>saturation</kwd>
        <kwd>digital color atlas</kwd>
        <kwd>small color difference</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        At the moment, the estimation of color and color differences of images are most often performed with the use of
three-color colorimeters [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], which involve the optical lighting system and the optical imaging system providing the
high spatial resolution. In such colorimeters, images are captured by photomatrices with three-color Bayer filters,
which may be popular imaging systems, such as digital cameras or scanners.
      </p>
      <p>
        The recognition and the quantification of small color differences are needed in printing industry [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], development
of devices using temperature-sensitive paints [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], criminal science [
        <xref ref-type="bibr" rid="ref4 ref5">4, 5, 6,</xref>
        ], expertise of documents, differentiation of
strokes of document details, etc.
      </p>
      <p>Problems solved with the use of computer vision are so versatile that almost each particular case requires the
development of specialized algorithms for the digital image processing [7, 8].</p>
      <p>Therefore, it is important to consider specific features of a design of illuminating blocks of colorimeters, to study
the color rendering of digital cameras (or photomatrices) and the quality of their color grading, and to develop
appropriate algorithms and software.</p>
      <p>The present paper describes the method of determining the spectral sensitivity of RGB-sensors of the camera with
the use of monochromatic stimuli. The experimental setup and the method of creating a digital atlas of
monochromatic stimuli are discussed. It is proposed to perform objective estimation of the color difference in similar
stimuli (or strokes of document details) by means of the mathematical processing of digital images of stimuli by using
developed algorithms including the calculation of the chart of color characteristics of stimulus images, its color
segmentation, and statistical analysis of data in the domains of interest.</p>
    </sec>
    <sec id="sec-2">
      <title>Methods and results</title>
      <p>For creating the monochromatic stimuli and studying the spectral dependence of the response of camera channels,
we developed an experimental setup consisting of a light source (the halogen lamp), a condenser, an universal
monochromator UM-2 (including the following elements: lens, comparison prism, variable-width input slot,
collimator objective, dispersing Abbe prism with a connected wavelength drum, telescope objective, and
variablewidth output slot), a multichannel fiber spectrometer Kolibri-2 (VMK-Optoelektronika, Novosibirsk, Russia), and
camera Canon EOS 500D (Canon Inc., Japan) with the objective.</p>
      <p>The light generated by the source is directed by the condenser through the lens to the input slot of the
monochromator, which is located at the focal point of the collimator objective; after that, the light passes through the
Abbe prism and is decomposed into a spectrum. The telescope objective produces the input slot image confocally
with the output slot of the monochromator, which is captured by the camera objective and is retained as a digital
image. The output slot of UM-2 serves as a source of a monochromatic radiation. The light spectrum was monitored
by the Kolibri-2 fiber spectrometer; the spectrum was captured with drum rotation and wavelength changing by 1 nm.</p>
      <p>
        For obtaining the digital color atlas, the images of the output slot of UM-2 were captured by the motionless (with
respect to the setup) digital mirror camera simultaneously with spectrum measurement by Kolibri-2. The camera
operated in the “user” mode, which was described in much detail in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. This regime does not allow image
preprocessing by a built-in processor of the camera at its disposal.
      </p>
      <p>In the visible spectrum, we obtained 168 images of spectral stimuli, i.e., digital atlas elements with a step of 1 nm.
The half-tone region in the each atlas element is removed. The resultant monochromatic stimuli allow the camera to
be tested and the spectral responses of the photomatrix to be constructed. The spectral response of the photomatrix is
a convolution of the spectral sensitivity function of the photomatrix itself with the function of the spectral distribution
of energy in the light source. Figure 1 shows the spectral sensitivity of the RGB elements of the photomatrix after
deconvolution with the lamp spectrum. The resultant curves are the transmission spectrum of the Bayer filter at the
photomatrix.</p>
      <p>Based on the monochromatic stimuli, we calculated the corresponding dominant wavelengths (DWLs); the DWL
values were averaged over the entire image of the stimulus. The stimuli coordinates were plotted on the chromaticity
diagram (x,y); thus, the color gamut of the camera was obtained, as is shown in Figure 2, where the solid bold curve is
presented for the mean values of the coordinates (x,y) on each stimulus, and the dotted and dashed curves are given
for the root-mean-square (RMS) deviations to the negative and positive sides, respectively. The resultant shape is
noticeably different from a triangle. The color gamut of the camera is located within the locus, where the wavelengths
of monochromatic stimuli are indicated.</p>
      <p>Thus, the method is proposed for testing the color rendering of digital cameras with the use of experimentally
obtained monochromatic stimuli. The method was tested by an example of the Canon EOS 500D camera.</p>
      <p>
        A correctly calibrated camera makes it possible to detect and quantify small color differences. Color
discrimination and quantification of color differences were performed in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] in the color space CIE LAB. The total
color difference ∆  ∗ is calculated as the Euclidean distance between two color points
      </p>
      <p>(∆  ∗ )2 = ( ∗ −  ∗ )2 + ( ∗ −  ∗ )2 + ( ∗ −  ∗ )2,
where the subscripts mean the tested stimulus (T) and the reference stimulus (R).</p>
      <p>
        In many applications [
        <xref ref-type="bibr" rid="ref7">9</xref>
        ], the value ∆  ∗ = 3 is taken as a threshold of a visual color discrimination, which
means that colors with the total color difference smaller than three cannot be reliably visually discriminated by the
observer.
      </p>
      <p>
        Barinova O.A. and Palchikova I.G. [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] reported the results of their experiments aimed to detecting adscripts with
the use of the VideoTool-М (TDISIE Sb RAS, Novosibirsk, Russia) three-color colorimeter [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. The experiments [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]
showed that the fact of changing the original writing in a document without document destruction can be established
by means of the differentiation of dyes with visually similar color characteristics by using their quantitative
characteristics, namely, a color saturation (CS) (or DWL) and a total color difference between two colors ∆  ∗ of
certain selected image regions. The problem in this approach is the necessity of identifying colored regions. Usually
dyes cannot be applied onto the paper surface homogeneously, and the stroke image always contains non-colored
spots, as is shown in Figure 3. Moreover, it is not always possible to identify the domain of interest exactly within the
stroke image because some part of the paper image is also captured. Because of all these factors, the image becomes
noisy, it is difficult to estimate the DWL difference, CS, and ∆  ∗ , and it is rather problematic to detect adscripts in
marginal cases (∆  ∗ ~4).
      </p>
      <p>We developed and tested a new algorithm for the detection and quantification of adscripts on the basis of the
digital photo image of the inscription made on. It is proposed to perform the objective analysis of the image by means
of dividing it into blocks of the color segmentation and estimation of the color tone and color difference. In this case,
the color segmentation block performs the preprocessing function, i.e., defines the chart of the boundaries of
differently colored classes for subsequent computations.</p>
      <p>To eliminate the influence of illumination inhomogeneity and objective vignetting, the white background is first
captured and the matrix of coefficients for the image normalization is calculated.
2.1</p>
      <p>Color segmentation</p>
      <p>
        In the problems considered, we have to separate the image area related to the paper from the colored areas, and
colors are very close to each other. Thus, all pixels have to be classified into two classes. Methods of threshold
segmentation of images based on their brightness are well known and have been developed in sufficient detail [
        <xref ref-type="bibr" rid="ref8">8, 10</xref>
        ].
In the present study, Otsu’s method [8] of the optimal global thresholding was modified as applied to the problem of
the image segmentation in terms of a color.
      </p>
      <p>Segmentation is performed on the basis of one of the quantitative parameters of color, namely, CS (or DWL).
RGB- matrices of the color image are used to calculate the matrix of CS values, which can contain values from 0 to 1.
Each pixel has a unique real value of CS; therefore, the CS histogram is a set of columns of unit height, but the
columns are not uniformly distributed along the abscissa axis from 0 to 1. Otsu’s algorithm does not allow finding the
segmentation threshold for such histogram of unique CS values. Otsu’s algorithm is usually applied to the histogram
of the monochromatic image brightness, where the brightness values are integers in the interval from 0 to 255 levels
of the gray scale. It is proposed to transform the CS histogram by means of rounding the values or division of the CS
range (from 0 to 1) into even parts. In our case, the CS range is divided into 200 parts, and the normalized CS
histogram for the inscription image is calculated. The proposed design of the CS histogram is the first step of the
modified Otsu’s algorithm for determining the segmentation threshold of the image on the basis of color saturation.
Other steps are the same as in the original algorithm [8, p. 863].</p>
      <p>The segmentation threshold is chosen by analyzing the histogram of the distribution of CS values in digital image
pixels. If the histogram contains two clearly discernible regions so that each region is the most compact one, then the
boundary between these regions in the histogram is the best threshold between the background and the inscription in
the image. The algorithm searches for the threshold so that the maximum dispersion of two regions between the
classes is reached. Based on the chosen CS threshold, the segmentation is performed: strokes having a greater CS are
separated from a paper having a smaller CS.</p>
      <p>
        The proposed color segmentation method was software implemented and the correctness of the software operation
was tested by an example of segmentation of images of the elements of the color atlas Macbeth ColorChecker chart
[
        <xref ref-type="bibr" rid="ref8">10</xref>
        ].
      </p>
      <p>The main stages of the color segmentation are illustrated in Figure 4.</p>
      <p>а</p>
      <p>The chosen CS threshold defines the boundaries of differently colored classes of the image for subsequent
computations. The chosen pixels that refer to dyes serve as data for calculating the values of (R,G,B) and (x,y)
coordinates in each pixel, and also the mean values of 〈R,G,B〉 over the domain of interest (along the stroke) and the
root mean square (RMS) values. Based on the (R,G,B) values, one can calculate the matrices of the CS and DWL
values, color differences, and also matrices of any recalculated values of the parameters. Such quantitative
characterization allows the domains of interest in the stroke images to be compared with each other. It can be
assumed that, if some strokes are performed with two different dyes, then the general set of the values of color angles
of the entire inscription will contain two normal distributions (in accordance with the number of dyes). To evaluate
whether the data distribution is consistent with the standard normal distribution, the block for the color difference
estimation was supplemented with the normal plot construction QQ-plot.</p>
      <p>
        The algorithm was tested by examples of detecting adscripts whose dyes could not be discriminated by
Selivanov’s color guide [
        <xref ref-type="bibr" rid="ref10">12</xref>
        ], and the high efficiency of the algorithm in solving expertise problems was confirmed.
      </p>
      <p>When processing the digital image data for monitoring the natural and man-made processes, one of the important
characteristics is the color of plants. The developed software were tested by an example of detection and
quantification of small color differences of dahlia leaves grown in spring on the southern (S) and northern (N)
windows (three containers on each window). Seventy four photos of plants on a white paper background were
captured and processed. When shooting, the same camera settings and then the same digital image processing
algorithm were used.</p>
      <p>The algorithm includes normalization of the original photo image to the image of the white background near the
plant image. For each container, the averaged color coordinates (x,y) and the mean DWL and CS values were
calculated. The coordinates of six points (in accordance with the number of containers) were plotted in the
chromaticity diagram (x,y). (Figure 5а). The dotted line in Figure 5a separating the S and N points is parallel to the
locus line; the direction of increasing saturation is indicated by the arrow. The samples had practically identical
colors. The difference in the mean group DWL values was slightly greater than 0.5 nm, whereas the RMS value was
±1.3 nm.</p>
      <p>It is seen in Figure 5a that the chromaticity points S and N are located almost along one CS line consecutively:
first there follows the point S (southern) and then the point N (northern) as the CS increases. Using the CS value, we
separated the groups from the southern and northern windows; the difference was approximately 2.8% (Figure 5b).
The northern samples displayed more saturated hues. The RMS values for the southern samples were 7% greater than
those for the northern samples. The mean value of the total color difference between the compared groups was
∆  ∗ = 4 . Thus, the groups were almost indiscernible visually. The use of the camera operating as a three-color
colorimeter revealed the difference in the growing conditions of plants of the same type and made it possible to
estimate the fine difference in the dahlia leaf color.</p>
    </sec>
    <sec id="sec-3">
      <title>Conclusions</title>
      <p>The unique experimental setup on the basis of the UM-2 monochromator was developed for obtaining the
monochromatic color stimuli with the controlled spectrum width. It was demonstrated that the spectral sensitivity of
the RGB-sensors and the color gamut of the camera could be tested with the use of monochromatic stimuli.</p>
      <p>The new algorithm was developed for detection and quantification of adscripts in the inscription photo image. It is
proposed to divide the objective analysis of the image into blocks of the color segmentation and the estimation of the
color background and the color difference. In this problem formulation, the block of color segmentation performs the
preprocessing function and defines the chart of the boundaries between differently colored classes for subsequent
computation of the color differences.</p>
      <p>Acknowledgements. The study was performed by the Russian Foundation for Basic Research and the Government of
the Novosibirsk Region within the framework of the Scientific Project No. 17-47-540269 and partly by the Russian
Foundation for Basic Research within the framework of Grant No. 19-08-00874.</p>
      <p>Kupin A.F. Forensic processing of manuscripts performed to mimic the handwriting of some other person. Ph.D.
Thesis, Moscow, 2012, 234 pp.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Palchikova</surname>
            <given-names>I.G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Aleinikov</surname>
            <given-names>A.F.</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Chugui</given-names>
            <surname>Yu</surname>
          </string-name>
          .V., et al.
          <article-title>Video analyzer of qualitative color characteristics</article-title>
          // Insiruments.
          <year>2014</year>
          . Vol.
          <volume>12</volume>
          . P 38 - 44.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Russian</given-names>
            <surname>Standard GOST R 52490 - 2005 (ISO</surname>
          </string-name>
          7724-3:
          <year>1984</year>
          ).
          <article-title>Paints and varnishes</article-title>
          .
          <source>Colorimetry. Part 3. Introduced</source>
          <year>2007</year>
          -
          <volume>01</volume>
          -01 (
          <issue>Standartinform</issue>
          , Moscow,
          <year>2006</year>
          , 6 pp.).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Russian</given-names>
            <surname>Standard GOST R</surname>
          </string-name>
          53698
          <article-title>-2009</article-title>
          .
          <article-title>Nondestructive inspection</article-title>
          .
          <source>Thermal methods. Terms and Definitions. Introduced</source>
          <year>2011</year>
          -
          <volume>01</volume>
          -01 (
          <issue>Standartinform</issue>
          , Moscow,
          <year>2010</year>
          , 8 pp.).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Barinova</surname>
            <given-names>O.A.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Palchikova</surname>
            <given-names>I.G.</given-names>
          </string-name>
          <article-title>Possibility of color analysis of dyes in technical forensic expertise of documents/ Forensic Examination</article-title>
          .
          <year>2017</year>
          . No.
          <volume>4</volume>
          (
          <issue>52</issue>
          ), P.
          <fpage>75</fpage>
          -
          <lpage>82</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Palchikova</surname>
            <given-names>I.G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Latyshov</surname>
            <given-names>I.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vasil'</surname>
            ev
            <given-names>V.A.</given-names>
          </string-name>
          , et al.
          <article-title>Color analysis of digital images for the expert inspection of shot traces//</article-title>
          <source>Proceedings of the Russian Higher School Academy of Sciences</source>
          .
          <year>2015</year>
          . No.
          <volume>2</volume>
          (
          <issue>27</issue>
          ). P.
          <volume>88</volume>
          -
          <fpage>101</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <surname>Gruzman</surname>
            <given-names>I.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kirichuk</surname>
            <given-names>V.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kosykh</surname>
            <given-names>V.P.</given-names>
          </string-name>
          , et al.
          <source>Digital Processing of Images in Information Systems. Novosibirsk: NGTU</source>
          .
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [9]
          <string-name>
            <surname>Judd</surname>
            <given-names>D.B.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Wyszecki</surname>
            <given-names>G.W.</given-names>
          </string-name>
          <article-title>Color in Business, Sciences, and Industry</article-title>
          . Wiley.
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Chochia</surname>
            <given-names>P.A.</given-names>
          </string-name>
          <article-title>Image segmentation based on the analysis of distances in an attribute space// Optoelectron</article-title>
          . Instrum. and
          <string-name>
            <given-names>Data</given-names>
            <surname>Processing</surname>
          </string-name>
          .
          <year>2014</year>
          . Vol.
          <volume>50</volume>
          . No. 6. P.
          <volume>613</volume>
          -
          <fpage>624</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Mc</surname>
            <given-names>Camy C.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Marcus</surname>
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Davidson</surname>
            <given-names>J.G.</given-names>
          </string-name>
          <article-title>A color rendition</article-title>
          chart//J. Appl. Photogr. Eng.
          <year>1976</year>
          . Vol.
          <volume>11</volume>
          . P.
          <volume>95</volume>
          -
          <fpage>99</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Selivanov</surname>
            <given-names>N.A.</given-names>
          </string-name>
          <string-name>
            <surname>Forensic Determinant</surname>
          </string-name>
          of Color. Moscow.
          <year>1977</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>