Abstract:
A pattern matching system, comprising a receiver, a comparison block, a calculation block, an output block, a ratio reading block, and a controller, is provided. A likeness value indicates how much a first and second image accords to each other. The receiver receives first and second image signal corresponding to the first and second images as an area signal. The comparison block compares the signal levels of the area signals corresponding to the pattern areas at the relatively same location of the first and second images. The calculation block calculates the likeness value. The ratio reading block reads a amplification ratio by which the first and second image signals are amplified. The controller changes the type of the signal components of the area signal used for the comparison by the comparison block and the calculation of the likeness value by the calculation block.

Description:
BACKGROUND OF THE INVENTION 
       [0001]    1. Field of the Invention 
         [0002]    The present invention relates to a pattern matching system that determines how much a plurality of images accords to each other. 
         [0003]    2. Description of the Related Art 
         [0004]    A pattern matching system that determines how much a plurality of images compares to each other is known. In the known pattern matching system, the entire captured image is divided into smaller pieces and the luminance values of the individual pieces are compared to the luminance values of corresponding pieces in the same location of different image. The determination of how similar the compared images are to one another is based on the number of corresponding pieces that have the same luminance values. In such a pattern matching method, it is difficult to carry out the pattern matching accurately when the brightness of the images varies substantially. 
       SUMMARY OF THE INVENTION 
       [0005]    Therefore, an object of the present invention is to provide a pattern matching system that accurately carries out the pattern matching for images with a wide variation in brightness. 
         [0006]    According to the present invention, a pattern matching system, comprising a receiver, a comparison block, a calculation block, an output block, a ratio reading block, and a controller, is provided. The pattern matching system outputs a likeness value. The likeness value indicates how much a first and second image accords to each other. The receiver receives a first and second image signal corresponding to the first and second images, respectively, as an area signal. The area signal comprises first and second color signal components or luminance and chrominance difference signal components corresponding to the color of a pattern area of which the first and second images are comprised. The comparison block compares signal levels of the area signals corresponding to the pattern areas at the relatively same location of the first and second images. The calculation block calculates the likeness value. The likeness value varies according to the number of the pattern areas where the absolute value of the difference between the compared signal levels of the area signal of the first and second images is less than a predetermined standard value. The output block outputs the likeness value. The ratio reading block reads an amplification ratio by which the first and second image signals are amplified. The controller changes the type of the signal components of the area signal used for the comparison by the comparison block and used for the calculation of the likeness value by the calculation block. 
         [0007]    Further, the controller orders the comparison block and the calculation block to compare signal levels and to calculate the likeness value, respectively, using only the first color signal component or the luminance signal component when the amplification ratio is greater than a predetermined threshold value. The controller orders the comparison block and the calculation block to compare signal levels and to calculate the likeness value, respectively, using the first and second color signal components or the luminance and chrominance difference signal components when the amplification ratio is less than a predetermined threshold value. 
         [0008]    According to the present invention, a pattern matching system, comprising an image signal generator, a detection block, a selection block, and a pattern matching block, is provided. The pattern matching system estimates how similar a first and second image are to one another. The image signal generator generates plural types of image signals corresponding to the first and second images. The detection block detects the brightness of the first and second image. The selection block selects a number of different types of the image signals for pattern matching based on the detected brightness so that an increase in the number of the selected types is directly proportional to the detected brightness. The pattern matching block carries out pattern matching of the first and second image using the selected type of image signal. 
         [0009]    Further, the selection block selects a singular type of the image signal when the detected brightness is less than a predetermined brightness. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0010]    The objects and advantages of the present invention will be better understood from the following description, with reference to the accompanying drawings in which: 
           [0011]      FIG. 1  is a block diagram showing the internal structure of a digital camera having a pattern matching system of a first embodiment of the present invention; 
           [0012]      FIG. 2  is a block diagram showing the structure of the light-receiving surface of the imaging device; 
           [0013]      FIG. 3  is a block diagram showing the internal structure of the DSP of a first embodiment; 
           [0014]      FIG. 4  is a block diagram showing the internal structure of the pursuit block of a first embodiment; 
           [0015]      FIG. 5  shows the light-receiving surface for explaining the form of the scanning area comprising pixel blocks; 
           [0016]      FIG. 6  shows the structure of the ERA of the imaging device; 
           [0017]      FIG. 7  shows a location of the CA 1  relative to the SA; 
           [0018]      FIG. 8  shows a location of the CA 2  relative to the SA; 
           [0019]      FIG. 9  shows a location of the CA 3  relative to the SA; 
           [0020]      FIG. 10  shows a location of the CA 4  relative to the SA; 
           [0021]      FIG. 11  shows a location of the CA 5  relative to the SA; 
           [0022]      FIG. 12  shows a location of the CA 6  relative to the SA; 
           [0023]      FIG. 13  shows a location of the CA 7  relative to the SA; 
           [0024]      FIG. 14  shows a location of the CA 8  relative to the SA; 
           [0025]      FIG. 15  shows an example of signal level of the green signal components of the pixel blocks included in the SA  FIG. 16  shows the green signal components of the pixel blocks described in  FIG. 15  that have been converted to binary values; 
           [0026]      FIG. 17  shows an example of the green signal components of the pixel blocks included in the CA 1  that have been converted to binary values; 
           [0027]      FIG. 18  is a first flowchart explaining the process for designation of the scanning area carried out by the pursuit block; 
           [0028]      FIG. 19  is a second flowchart explaining the process for designation of the scanning area carried out by the pursuit block; 
           [0029]      FIG. 20  is a flowchart explaining the process for a first determination carried out by the pursuit block; and 
           [0030]      FIG. 21  is a flowchart explaining the process for a second determination carried out by the pursuit block. 
       
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
       [0031]    The present invention is described below with reference to the first and second embodiments shown in the drawings. 
         [0032]    In  FIG. 1 , a digital camera  10  comprises a photographic optical system  11 , an imaging device  12 , an analog front end (AFE)  13 , a digital signal processor (DSP)  14 , an input block  15 , a zooming driver  16 , a focusing driver  17 , and other components. 
         [0033]    The photographic optical system  11  is optically connected to the imaging device  12 . An optical image of an object through the photographic optical system  11  is incident to the light-receiving surface of the imaging device  12 . The imaging device  12  is, for example, a CCD area sensor. When the imaging device  12  captures the optical image of the object upon its light-receiving surface, the imaging device  12  generates an image signal corresponding to the captured optical image. 
         [0034]    The photographic optical system  11  comprises plural lenses, including a zoom lens  11   a  and a focus lens  11   b . The zoom lens  11   a  and the focus lens  11   b  are movable along the optical axis of the photographic optical system  11 . 
         [0035]    The zoom lens  11   a  and the focus lens  11   b  form a zoom optical system. The focal length of the photographic optical system  11  is adjusted by moving the zoom lens  11   a  and the focus lens  11   b  in relationship to each other. An optical image of an object can be focused on the light-receiving surface of the imaging device  12  by moving the focus lens  11   b.    
         [0036]    The zoom lens  11   a  and the focus lens  11   b  can be moved along the optical axis by the manual operation of a user. In addition, the zoom lens  11   a  and the focus lens  11   b  can also be moved by the zooming driver  16 . In addition, the focus lens  11   b  can be moved by the focusing driver  17  for the focus adjustment. Incidentally, the focus adjustment is automatically carried out when an auto focus function, as described later, is commenced. 
         [0037]    A diaphragm  18  and a shutter  19  are mounted between the photographic optical system  11  and the imaging device  12 . The intensity of light made incident on the light-receiving surface of the imaging device  12  can be varied by adjusting the aperture ratio of the diaphragm  18 . An optical image reaches the light-receiving surface by opening the shutter  19 , and an optical image is shielded from the light-receiving surface by closing the shutter  19 . A diaphragm-driver  20  drives the diaphragm  18  so that the aperture ratio can be adjusted. A shutter-driver  21  drives the shutter  19  so that the shutter  19  can be opened and closed. 
         [0038]    Incidentally, the zooming driver  16 , the focusing driver  17 , the diaphragm driver  20 , and the shutter driver  21  are all connected to the DSP  14 . The DSP  14  controls the operations of the zooming driver  16 , the focusing driver  17 , the diaphragm driver  20 , and the shutter driver  21 . 
         [0039]    The imaging device  12  is electrically connected to the DSP  14  via the AFE  13 . A clock signal is sent from the DSP  14  to the AFE  13 , which generates a frame signal and an imaging device driving signal based on the received clock signal. The imaging device driving signal is sent to the imaging device  12 . The imaging device  12  is driven, based on the imaging device driving signal, to generate an image signal that is synchronized with the frame signal. 
         [0040]    As shown in  FIG. 2 , a plurality of pixels  12   p  are arranged in a matrix on the light-receiving surface of the imaging device  12 . Each pixel  12   p  within an effective receiving area, hereinafter referred to as an ERA, is covered with one of either a red, green, or blue color filter. The red, green, and blue color filters are arranged according to the Bayer color array. 
         [0041]    A red pixel  12   pr  which is covered with the red color filter generates a red signal charge according to the intensity of the red light component incident to the red pixel  12   pr . A green pixel  12   pg  which is covered with the green color filter generates a green signal charge according to the intensity of the green light component incident to the green pixel  12   pg . A blue pixel  12   pb  which is covered with the blue color filter generates a blue signal charge according to the intensity of the blue light component incident to the blue pixel  12   pb.    
         [0042]    Incidentally, the imaging device  12  comprises vertical CCDs  12   v , a horizontal CCD  12   h , and an output block  12   o . The red, green, and blue signal charges are transmitted in order to the output block  12   o  through the vertical and horizontal CCDs  12   v ,  12   h . The output block  12   o  converts the red, green, blue signal charges into red, green, and blue pixel signals that are potential signals, respectively. Incidentally, the image signal comprises red, green, and blue pixel signals. 
         [0043]    The generated image signal is sent to the AFE  13  (see  FIG. 1 ). The AFE  13  carries out correlated double sampling on the image signal and amplifies the image signal by an amplification ratio (or gain) that is designated by the DSP  14 . Next, the image signal is converted to image data, which is digital data, and is sent to the DSP  14 . 
         [0044]    The DSP  14  is connected to a dynamic random access memory (DRAM)  22 , which is used as a work memory for the signal processing that is carried out by the DSP  14 . The image data received by the DSP  14  is temporarily stored in the DRAM  22 . The DSP  14  carries out predetermined data processing on the image data stored in the DRAM  22 . 
         [0045]    The DSP  14  is connected to a monitor  23 . The image data, having undergone predetermined signal processing, is sent to the monitor  23  that is able to display an image corresponding to the received image data. 
         [0046]    The DSP  14  is connected to a card-interface  24  that can be connected to a memory card (not depicted). When a release operation is carried out, as described later, the image data, having undergone predetermined data processing, is stored in the memory card. 
         [0047]    The DSP  14  is connected to the input block  15 , where a user inputs operational commands. The input block  15  comprises a release button (not depicted), a multi-functional cross-key (not depicted), a power button (not depicted), and other buttons. The DSP  14  orders each component of the digital camera  10  to carry out a necessary operation according to a user&#39;s command input to the input block  15 . 
         [0048]    For example, by depressing the release button halfway, a first switch (not depicted) is switched on, and exposure adjustment and focus adjustment are then carried out. 
         [0049]    In the exposure adjustment, adjustment of the aperture ratio of the diaphragm  18 , adjustment of shutter speed, and the gain adjustment of the image data by the AFE  13 , are carried out. For the gain adjustment, the DSP  14  designates the amplification ratio. For the designation of the amplification ratio, the DSP  14  generates luminance data corresponding to each pixel based on red, green, and blue pixel signals. The amplification ratio is designated so that the average data level of luminance data corresponding to an image signal is equal to a predetermined data level. Consequently, when the intensity of light incident to the light-receiving surface is low, the DSP  14  designates a high amplification ratio. Then, the AFE  13  amplifies the image signal by the high amplification ratio. In the focus adjustment, the position of the focus lens  11   b  is adjusted so that an optical image of the object can be focused on the light-receiving surface. 
         [0050]    Further, by fully depressing the release button, a second switch (not depicted) is switched on. Then, the shutter  19  is driven so as to open and close, and the imaging device  12  is driven so as to capture a static optical image. 
         [0051]    Next, the internal structure of the DSP  14  is explained below, using  FIG. 3 . The DSP  14  comprises a first data processing block  14   p   1 , a second data processing block  14   p   2 , a pursuit block  30 , an AF adjustment block  14   a , and a control block  14   c.    
         [0052]    The image data sent from the AFE  13  is input to the first data processing block  14   p   1 , which stores the received image data in the DRAM  22 . In addition, the first data processing block  14   p   1  carries out predetermined data processing, such as color interpolation processing, white balance processing, and luminance data generation processing on the stored image data. The first data processing block  14   p   1  then sends the image data, after having undergone predetermined data processing, to the second data processing block  14   p   2 . 
         [0053]    The second data processing block  14   p   2  carries out predetermined data processing, such as cramp processing and blanking processing, on the received image data. Afterwards, the second data processing block  14   p   2  sends the image data to the monitor  23  or the memory card via the card-interface  24 . 
         [0054]    The first data processing block  14   p   1  also sends the image data to the pursuit block  30  and the AF adjustment block  14   a . Based on the received image data, the pursuit block  30  and the AF adjustment block  14   a  determine, in cooperation with each other, the position of the focus lens  11   b  so that a desired object is brought into focus on the light-receiving surface of the imaging device  12 . 
         [0055]    The pursuit block  30  designates one partial area of the entire captured image as a scanning area, hereinafter referred to as the SA. The SA is used for capturing an optical image of an object that is desired by the user to be in focus on the light-receiving surface. If the targeted object, which is the object desired to be in focus, moves within the captured image, the pursuit block  30  pursues the targeted object by sequentially re-designating a new partial area where the targeted object has moved, effectively updating the SA. 
         [0056]    The AF adjustment block  14   a  determines the position of the focus lens  11   b  so that an optical image captured by the SA is in focus. Incidentally, the position of the focus lens  11   b  is determined according to the contrast detection method. 
         [0057]    The digital camera  10  has both normal auto focus and pursuit auto focus functions. By carrying out the normal auto focus function, an object that is located in a fixed partial area of the entire captured image is brought into focus. By carrying out the pursuit auto focus function, an object that moves within the entire captured image is brought into focus. Either the normal auto focus function or the pursuit auto focus function is selected by an operational command to the input block  15 . 
         [0058]    An input signal that corresponds to an operational command input to the input block  15  is sent from the input block  15  to the control block  14   c . The control block  14   c  controls the first data processing block  14   p   1 , the second data processing block  14   p   2 , the pursuit block  30 , the AF adjustment block  14   a , and each component of the digital camera  10  according to the received input signal. 
         [0059]    For example, in the exposure adjustment the control block  14   c  controls both the diaphragm driver  20  to drive the diaphragm  18  and the shutter driver  21  to open and close the shutter  19 . 
         [0060]    Further, the control block  14   c  controls the focusing driver  17  to re-position the focus lens  11   b  in the focus adjustment. In the focus adjustment, the control block  14   c  receives lens position data corresponding to the position of the focus lens  11   b , as determined by the AF adjustment block  14   a . The control block  14   c  controls the focusing driver  17  based on the received lens position data. 
         [0061]    Further, the control block  14   c  designates the amplification ratio used for amplification of the image signal by the AFE  13 . In addition, when the pursuit auto focus function is carried out, the control block  14   c  determines whether or not the designated amplification ratio is greater than a first threshold value. When the amplification ratio is greater than the first threshold value, the control block  14   c  orders the pursuit block  30  to pursue the targeted object using the green pixel signal components in the image data. On the other hand, when the amplification ratio is less than the first threshold value, the control block  14   c  orders the pursuit block  30  to pursue the targeted object using the red, green, and blue pixel signal components in the image data. 
         [0062]    The brighter the optical image of the object, the lower the designated amplification ratio, in general. Accordingly, when the optical image of the object is bright enough to designate an amplification ratio that is less than the first amplification value, the pursuit of the targeted object is carried out using signal components corresponding to red, green, and blue color components. On the other hand, when the optical image of the object is dark enough to designate an amplification ratio that is greater than the first amplification value, the pursuit of the targeted object is carried out using only one signal component that corresponds to the green color component. 
         [0063]    Next, the structure and operation of the pursuit block  30  are explained in detail below, using  FIG. 4 . The pursuit block  30  comprises a first setting block  31 , a second setting block  32 , a recognition block  33 , and a third setting block  34 . Incidentally, each component is controlled by the control block  14   c.    
         [0064]    On carrying out the focusing adjustment, the first setting block  31  initially designates an SA on the light-receiving surface. As shown in  FIG. 5 , the SA comprises thirty two pixel blocks  12   b . In addition, the form of the SA is in the shape of a cross shape, created by removing four corner blocks from a rectangle comprising pixel blocks  12   b  of six columns across by six rows down. 
         [0065]    As shown in  FIG. 6 , the pixel block  12   b  is a unit of area representing 1/400 of the ERA, which has been equally partitioned into twenty rows and twenty columns. The pixel block  12   b  is equally partitioned itself, so that the pixel block  12   b  comprises one hundred pixels arranged in a matrix of ten rows by ten columns. Incidentally, the pattern matching described later is carried out based on a signal component corresponding to the pixel block  12   b  in the pursuit function that minimizes processing time. 
         [0066]    The first setting block  31  determines the initial location of the SA so that the centers of both the ERA of the imaging device  12  and the SA agree with each other (see  FIG. 5 ). 
         [0067]    Incidentally, the pixel blocks  12   b  on the ERA are separated from each other by borderlines formed by a plurality of vertical and horizontal lines demarcating the columns and rows created from partitioning the ERA. One of the many intersection points formed by the crosshairs of intersecting vertical and horizontal borderlines can be decided upon as the center of the SA, and the location of the initial SA is designated from the location of the center of the SA. The location of the SA is designated based on the operational command which is input to the input block  15 . 
         [0068]    Data corresponding to the initially designated SA is sent to the second setting block  32 . The second setting block  32  designates eight candidate areas which are of the same size as the current SA, but whose locations are different and determined by displacing the current SA by the same magnitude, but in eight different directions. 
         [0069]    The first˜eighth directions are predetermined as the eight directions in which to displace the SA to designate the candidate areas. The upper, upper left, left, lower left, lower, lower right, right, and upper right directions are predetermined as the first, second, third, fourth, fifth, sixth, seventh, and eighth directions, respectively, as in  FIG. 5 . 
         [0070]    One pixel block  12   b  is predetermined to correspond to the distance from the SA to each candidate area. Incidentally, the locations of first˜eighth candidate areas are explained below. 
         [0071]    A candidate area displaced through one pixel block  12   b  from the SA in the first direction is designated to be the first candidate area, hereinafter referred to as CA 1 , shown in  FIG. 7 . A candidate area displaced through one pixel block  12   b  from the SA in the second direction is designated to be the second candidate area, hereinafter referred to as CA 2 , shown in  FIG. 8 . A candidate area displaced through one pixel block  12   b  from the SA in the third direction is designated to be the third candidate area, hereinafter referred to as CA 3 , shown in  FIG. 9 . A candidate area displaced through one pixel block  12   b  from the SA in the fourth direction is designated to be the fourth candidate area, hereinafter referred to as CA 4 , shown in  FIG. 10 . A candidate area displaced through one pixel block  12   b  from the SA in the fifth direction is designated to be the fifth candidate area, hereinafter referred to as CA 5 , shown in  FIG. 11 . A candidate area displaced through one pixel block  12   b  from the SA in the sixth direction is designated to be the sixth candidate area, hereinafter referred to as CA 6 , shown in  FIG. 12 . A candidate area displaced through one pixel block  12   b  from the SA in the seventh direction is designated to be the seventh candidate area, hereinafter referred to as CA 7 , shown in  FIG. 13 . A candidate area displaced through one pixel block  12   b  from the SA in the eighth direction is designated to be the eighth candidate area, hereinafter referred to as CA 8 , shown in  FIG. 14 . 
         [0072]    Data corresponding to the designated CA 1 ˜CA 8  is sent to the recognition block  33 , as is data corresponding to the SA initially designated by the first setting block  32 . In addition, the red, green, and blue pixel signal components for each pixel in the image data are sent to the recognition block  33  from the first data processing block  14   p   1 . 
         [0073]    The recognition block  33  generates either a green signal component or red, green, and blue signal components for each pixel block  12   b  comprising the SA and the CA 1 ˜CA 8 , comprises based on one frame of image data. Incidentally, only the green signal component is generated for the pixel blocks  12   b  when the amplification ratio is greater than the first threshold value. The red, green, and blue signal components of the pixel blocks  12   b  are generated when the amplification ratio is less than the first threshold value. 
         [0074]    The green signal component of the pixel blocks  12   b  is calculated by averaging the green pixel signals of the pixels  12   p  in the pixel blocks  12   b  comprising the SA and the CA 1 ˜CA 8 . The red, green, and blue pixel block signal components of the pixel block  12   b  are calculated by averaging the red, green, and blue pixel signals in the pixel blocks  12   b  comprising the SA and the CA 1 ˜CA 8 , respectively. 
         [0075]    For example, assuming the image data sent at a first point in time contains the green signal levels  120 ,  30 ,  60 ,  55 ,  70 ,  110 ,  100 ,  70 ,  40 ,  105 ,  40 ,  85 ,  95 ,  65 ,  25 ,  40 ,  150 ,  120 ,  60 ,  30 ,  25 ,  45 ,  100 ,  120 ,  110 ,  95 ,  80 ,  50 ,  90 ,  75 ,  80 , and  20  for the pixel blocks  12   b  comprising the SA from left to right and from top to bottom, respectively, these signal levels are calculated as the green signal components corresponding to the SA at the first point in time (see  FIG. 15 ). 
         [0076]    The green signal components or the red, green, and blue signal components for the pixel blocks  12   b  of the SA and the CA 1 ˜CA 8  are converted to binary values, for example 0 or 1, based on the generated signal components. For the conversion to binary values, an average value of the signal levels of each color pixel signal components for the pixel blocks  12   b  comprising the SA and the CA 1  CAB is calculated, and each individual signal level is subsequently compared to the average signal level. If a signal level is higher than the average signal level, the signal level is converted to 1. If a signal level is lower than the average signal level, the signal level is converted to 0. 
         [0077]    For example, the average of the signal levels of the green signal components of the pixel blocks  12   b  in the SA shown in  FIG. 15  is 73.75. In the conversion to binary values, the signal level of the green signal components for the pixel blocks  12   b  in the SA are converted to 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, and 0 from left to right and from top to bottom, respectively (see  FIG. 16 ). Incidentally, the signal levels of the red, green, and blue signal components of the pixel blocks  12   b  are converted to binary values in a similar manner. 
         [0078]    Data corresponding to the green signal components of the pixel blocks  12   b  that have been converted to binary values is sent to the third setting block  34 , which infers to which of the CA 1 ˜CA 8  the target object, which has been captured by the SA at the current point in time, is moved to at the subsequent time of image capture. 
         [0079]    Incidentally, the inference is carried out based on the green signal components of the pixel blocks  12   b  in the SA that have been converted to binary values at one point in time, and the green signal components of the pixel blocks  12   b  in the CA 1 ˜CA 8  that are generated and converted to binary values from a different frame of image data captured at as subsequent point in time. 
         [0080]    The calculation of the first˜eighth likeness values is prerequisite to determining which candidate area is selected from the CA 1 ˜CA 8 . The determination of the selected candidate area based on the calculated first˜eighth likeness values is described in detail below. 
         [0081]    The first˜eighth likeness values are calculated values that indicate how similar the image captured in the SA is to the images captured in the CA 1 ˜CA 8  at the time of subsequent image capture. To calculate each likeness value, two green signal components converted to binary values for pixel blocks  12   b  at the relatively same location in both the SA and the CA 1 ˜CA 8  are compared to each other, and it is determined whether or not they are equal to each other. The likeness value is the number of combinations of green signal components compared to one another whose signal levels are unequal. Accordingly, the lower the likeness value, the greater the similarity inferred between the images captured in the SA and the candidate area. 
         [0082]    The third setting block  34  comprises an exclusive-or circuit (not depicted). The green signal components of the pixel blocks  12   b  at the relatively same location in the SA and the CA 1  that have been converted to binary values are input to the exclusive-or circuit. When the green signal components of the pixel blocks  12   b  at the relatively same location in the SA and the CA 1  that have been converted to binary values are equal to each other, the exclusive-or circuit outputs 0. On the other hand, when the green signal components of the pixel blocks  12   b  at the relatively same location in the SA and the CA 1  that have been converted to binary values are unequal to each other, the exclusive-or circuit outputs 1. 
         [0083]    For example, the green signal components for the pixel blocks  12   b  in the CA 1  that have been converted to binary values are 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, and 0 from left to right and from top to bottom, respectively, as shown in  FIG. 17 . When the green signal components in the top row and leftmost column for the pixel block  12   b  in the SA and the CA 1  that have been converted to binary values are input to the exclusive-or circuit, the exclusive-or circuit outputs 1. Similarly, when the green signal components in the top row and second to leftmost column for the pixel block  12   b  in the SA and the CA 1  that have been converted to binary value are input to the exclusive-or circuit, the exclusive-or circuit outputs 0. Hereinafter, similarly, when the combinations of the green signal components converted to binary values of the pixel block  12   b  in the SA and the CA 1  at the relatively same location are input to the exclusive-or circuit from left to right and from top to bottom, the exclusive-or circuit outputs 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, and 0, respectively. The number of times the exclusive-or circuit outputs 1 is counted and saved as a first likeness value, hereinafter referred to as U(exor). 
         [0084]    Similarly, the SA and the CA 2  are compared to each other, and the second likeness value, hereinafter referred to as UL(exor), is calculated. Similarly, the SA and the CA 3  are compared to each other, and the third likeness value, hereinafter referred to as L(exor), is calculated. Similarly, the SA and the CA 4  are compared to each other, and the fourth likeness value, hereinafter referred to as DL(exor), is calculated. Similarly, the SA and the CA 5  are compared to each other, and the fifth likeness value, hereinafter referred to as D(exor), is calculated. Similarly, the SA and the CA 6  are compared to each other, and the sixth likeness value, hereinafter referred to as DR(exor), is calculated. Similarly, the SA and the CA 7  are compared to each other, and the seventh likeness value, hereinafter referred to as R(exor), is calculated. Similarly, the SA and the CA 8  are compared to each other, and the eighth likeness value, hereinafter referred to as UR(exor), is calculated. 
         [0085]    The third setting block  34  determines the lowest likeness value among U(exor), UL(exor), L(exor), DL(exor), D(exor), DR(exor), R(exor), and UR(exor). The candidate area of which the likeness value is the lowest is determined and selected by the third setting block  34  as the area where the targeted object has moved from the scanning area. The selected candidate area is re-designated as the new scanning area. 
         [0086]    Incidentally, when the recognition block  33  generates the red, green, and blue signal components of the pixel blocks  12   b , the first˜eighth red likeness values, first˜eighth green likeness values, and first˜eighth blue likeness values are calculated based on the signal level of the red, green, and blue signal components of the pixel blocks  12   b , similar to the above. Next, the first red, green, and blue likeness values are summed up and calculated as the U(exor). The UL(exor), L(exor), DL(exor), D(exor), DR(exor), R(exor), and UR(exor) are calculated similar to the U(exor). Lastly, the third setting block  34  determines the lowest likeness value among the U(exor), UL(exor), L(exor), DL(exor), D(exor), DR(exor), R(exor), and UR(exor). The candidate area of which likeness value is the lowest is determined and selected by the third setting block  34  as the area where the targeted object has moved from the scanning area. The selected candidate area is re-designated as the new scanning area. 
         [0087]    Incidentally, when the normal auto focus function is carried out, only the first setting block  31  in the pursuit block  30  is functional, while the second setting block  32 , the recognition block  33 , and the third setting block  34  are suspended. 
         [0088]    Data corresponding to the SA initially designated by the first setting block  31  is sent to the AF adjustment block  14   a  through the recognition block  33  and the third setting block  34 . Incidentally, the initially designated SA remains the SA in the normal auto focus function, dissimilar to the pursuit auto focus function. 
         [0089]    Next, the process for designation of the scanning area carried out by the pursuit block  30  is explained using the flowchart of  FIGS. 18 and 19 . 
         [0090]    The process for designation of the scanning area starts when the release button is depressed halfway, effectively switching on the pursuit auto focus function. Incidentally, the process for designation of the scanning area is repeated until the power button is switched off or the pursuit auto focus function is switched off. 
         [0091]    At step S 100 , the SA is initially designated. The SA is designated so that the center of the SA is located at a point in accordance to a user&#39;s command input. 
         [0092]    At step S 101  subsequent to step S 100 , one frame of image data is received. After receiving the image data, the process proceeds to step S 102 , where the CA 1 ˜CA 8  are designated based on the designated SA. 
         [0093]    After designation of the CA 1 ˜CA 8 , the process proceeds to step S 103 , where the control block  14   c  reads the amplification ratio used in the AFE  13 . At step S 104  subsequent to step S 103 , the amplification ratio is compared to the first threshold value. 
         [0094]    When the amplification ratio is greater than the first threshold value, the process proceeds to step S 105 , where the green signal components of the pixel blocks  12   b  in the SA are generated based on the latest received image data. On the other hand, when the amplification ratio is less than the first threshold value, the process proceeds to step S 106 , where the red, green, and blue signal components of the pixel blocks  12   b  in the SA are generated based on the latest received image data. 
         [0095]    After either step S 105  or step S 106  is complete, the process proceeds to step S 107 , where the green signal components generated at step S 105  or the red, green, and blue signal components generated at step S 106  are converted to binary values. 
         [0096]    After conversion to binary values, the process proceeds to step S 108 , where the pursuit block  30  receives a frame of subsequently generated image data. At step S 109  subsequent to step S 108 , the amplification ratio of the latest received image data is compared to the first threshold value. 
         [0097]    When the amplification ratio is greater than the first threshold value, the process proceeds to step S 110 , where the green signal components of the pixel blocks  12   b  in the CA 1 ˜CA 8  are generated based on the latest received image data. On the other hand, when the amplification ratio is less than the first threshold value, the process proceeds to step S 111 , where the red, green, and blue signal components of the pixel blocks  12   b  in the CA 1 ˜CA 8  are generated based on the latest received image data. 
         [0098]    After either step S 110  or step S 111  is complete, the process proceeds to step S 112 , where the green signal components generated at step S 110  or the red, green, and blue signal components generated at step S 111  are converted to binary values. 
         [0099]    After conversion to binary values, the process proceeds to step S 113 , where the U(exor), UL(exor), L(exor), DL(exor), D(exor), DR(exor), R(exor), and UR(exor) are calculated based on the color signal components of the pixel blocks  12   b  in the SA and the CA 1 ˜CA 8  that have been converted to binary values. 
         [0100]    At step S 114  subsequent to step S 113 , the candidate area, of which the likeness value is the lowest among the U(exor), UL(exor), L(exor), DL(exor), D(exor), DR(exor), R(exor), and UR(exor), is designated as the new SA. 
         [0101]    After completion of step S 114 , the process returns to step S 102 , and steps S 102 ˜ 114  are repeated. 
         [0102]    In the above first embodiment, the signal component used for the pattern matching can be changed to either the singular green signal component, or the aggregate of the red, green, and blue signal components, according to the amplification ratio by the AFE  13  based on the brightness of the object. 
         [0103]    In general, the accuracy of pattern matching can be improved by using many different color signal components. On the other hand, when the signal level of the pixel signal prior to the amplification is low because of a low amount of light received by a pixel  12   p , the S/N is also decreased accordingly. In such a case, the accuracy of pattern matching may deteriorate by using many different color signal components. 
         [0104]    It is general knowledge for a prior digital camera to lower an amplification ratio when an optical image of an object is bright and to raise the amplification ratio when the optical image is dark. So, by changing the color signal components used for the pattern matching, according to the amplification ratio, the capability exists to carry out accurate pattern matching for an object whether the optical image of the object is bright or dark. 
         [0105]    Next, a pattern matching system of the second embodiment is explained below, using  FIGS. 20 ,  21 . The primary difference between the second embodiment and the first embodiment, which is explained below, is the type of signal component used for pattern matching. Incidentally, the same symbols are used for the structures that are comparable to those in the first embodiment. 
         [0106]    The structures and functions of the digital camera of the second embodiment, with the exception of the DSP, are the same as those of the first embodiment. The functions of the first data processing block  140   p   1  and a pursuit block  300  of the DSP  300  are especially different from those of the first embodiment (see  FIG. 20 ). 
         [0107]    The first data processing block  140   p   1  carries out chrominance difference data generation processing in addition to the predetermined data processing of the first embodiment. Incidentally, by luminance data generation processing and chrominance difference data generation processing, data corresponding to luminance, hereinafter referred to as Y, and data corresponding to chrominance difference, hereinafter referred to as Cr and Cb are generated. Further, the first data processing block  140   p   1  sends the image data, having undergone predetermined data processing, to the second data processing block  140   p   2 . 
         [0108]    The second data processing block  140   p   2  carries out predetermined data processing similar to the first embodiment. 
         [0109]    The first data processing block  140   p   1  sends the image data to the pursuit block  300 . Based on the received image data, the pursuit block  300  pursues the targeted object. 
         [0110]    In the pursuit block  300 , only the functions of the recognition block  330  and the third setting block  340  are different from those of the first embodiment (see  FIG. 21 ). The first setting block  31  initially designates an SA, similar to the first embodiment. In addition, the second setting block designates the CA 1 ˜CA 8 . 
         [0111]    Data corresponding to the initially designated SA and the designated CA 1 ˜CA 8  is sent from the first setting block  31  and the second setting block  32 , respectively, to the recognition block  330 , similar to the first embodiment. In addition, data corresponding to the Y and the Cr/Cb of each pixel  12   p  are sent from the first data processing block  140   p   1  to the recognition block  330 . 
         [0112]    The recognition block  330  generates the Y and Cr/Cb of each pixel block  12   b  comprising the SA and the CA 1 ˜CA 8 . Incidentally, only the Y of the pixel blocks  12   b  is generated when the amplification ratio is greater than the first threshold value. However, both Y and Cr/Cb of the pixel blocks  12   b  are generated when the amplification ratio is less than the first threshold value. 
         [0113]    The Y of the pixel blocks  12   b  is calculated by averaging the Y of the pixels  12   p  in the pixel blocks  12   b  comprising the SA and the CA 1 ˜CA 8 . The Y and Cr/Cb of the pixel blocks  12   b  are calculated by averaging the Y and Cr/Cb of the pixel blocks  12   b  comprising the SA and the CA 1  ˜CA 8 , respectively. 
         [0114]    The singular Y or the combination of Y and Cr/Cb of the pixel blocks  12   b  of the SA and the CA 1 ˜CA 8  are converted to binary values. 
         [0115]    Data corresponding to the singular Y or the combination of Y and Cr/Cb of the pixel blocks  12   b  that have been converted to binary values is sent to the third setting block  340 , which infers to which one of the CA 1 ˜CA 8  the target object has moved at the time of a captured image that is subsequent to target object&#39;s previous capture by the SA at an earlier point in time. 
         [0116]    Incidentally, the inference is carried out based on the singular Y or the combination of Y and Cr/Cb of the pixel blocks  12   b  in the SA that were converted to binary values, at one point in time; and the singular Y or the combination of Y and Cr/Cb of the pixel blocks  12   b  in the CA 1 ˜CA 8  that were converted to binary values, at subsequent point in time. 
         [0117]    The U(exor), UL(exor), L(exor), DL(exor), D(exor), DR(exor), R(exor), and UR(exor) are calculated similar to the first embodiment, and one candidate area is selected from the CA 1 ˜CA 8  based on the U(exor), UL(exor), L(exor), DL (exor), D (exor), DR (exor), R (exor), and UR (exor). 
         [0118]    In the above second embodiment, the signal component used for the pattern matching can be changed to either the singular Y, or the combination of Y and Cr/Cb, according to the amplification ratio determined by the AFE  13  based on the brightness of the object being pursued. Accordingly, accurate pattern matching can be accomplished for an object whether an optical image of the object is bright or dark, similar to the first embodiment. 
         [0119]    In addition, in the above first and second embodiments, pattern matching can be carried out with greater stability because the signal components of each pixel block  12   b  are converted to binary values. For example, when the SA or a candidate area receives light emitted from a light source generating flicker, such as fluorescent light, a portion of the calculated likeness value may not accord to the actual optical image. However, because influence of such flicker is reduced upon the conversion to binary values, pattern matching can be carried out with greater stability. 
         [0120]    In the first embodiment, when the amplification ratio is less than the first threshold value, the red, green and blue signal components are used for the pattern matching. However, the pattern matching may be carried out using only the red and green signal components, or only the green and blue signal components, when the amplification ratio is in the range between the first threshold value and a second threshold value that is less than the first threshold value. In addition, when the amplification ratio is less than the second threshold value, three different color signal components may be used. Even if only two different color signal components are used, pattern matching is still more accurate than that using only the green signal component. 
         [0121]    In the second embodiment, when the amplification ratio is less than the first threshold value, the Y and Cr/Cb are used for the pattern matching. However, the pattern matching may be carried out using the Y and only one of either the Cr or Cb. 
         [0122]    For pattern matching, only the green signal component is used when the amplification ratio is greater than the first threshold value, and the red, green, and blue signal components are used when the amplification ratio is less than the first threshold value, in the first embodiment. However, the type of the signal component used for pattern matching may be changed according to the amplification ratio. 
         [0123]    For example, when the amplification ratio is great, the red, green, and blue signal components can be used for pattern matching. Generally, when the amplification ratio is great, it is preferable to use a singular signal component for the pattern matching as described in the above embodiments. However, if the color component of an optical image of an object is extremely partial, the accuracy of pattern matching using a singular color signal component may deteriorate. In such a case, it is preferable to increase the type of the color signal components used for the pattern matching, according to the amplification ratio. 
         [0124]    Similarly, for pattern matching, only the Y is used when the amplification ratio is greater than the first threshold value, while both the Y and Cr/Cb are used when the amplification ratio is less than the first threshold value, in the second embodiment. However, the type of the signal component used for pattern matching may be changed according to the amplification ratio. 
         [0125]    The number of the pixel blocks  12   b  comprising the SA and the candidate area is thirty two, in the above first and second embodiments. However, any numbers are adaptable. In addition, the shape of the SA and the candidate area is in the shape of a cross, in the first and second embodiments. However, any shape is adaptable. 
         [0126]    One direction in which the targeted object is moved is determined from the first˜eighth directions in the above first and second embodiments. However, one direction may be determined from a plurality of directions. 
         [0127]    One pixel block  12   b  corresponds to the magnitude of displacement from the SA to the CA 1 ˜CA 8 , in the above first and second embodiments. However, any number of pixel blocks  12   b  can correspond to the magnitude of displacement. 
         [0128]    The signal components of the pixel blocks  12   b  comprising the SA and the CA 1 ˜CA 8  are converted to binary values in the above first and second embodiments. However, the signal components can be converted to any number of different levels, or, such conversions may not be carried out at all. Of course, the effect as described above is achieved by carrying out the conversion to binary values or into values of a level that is different from that of binary values. 
         [0129]    The exclusive-or circuit outputs 0 when the signal components converted to binary value of the pixel blocks  12   b  at the relatively same location of the SA and the CA 1  ˜CA 8  are equal to each other, in the above first and second embodiments. However, an arithmetical circuit mounted in the third setting block  34  may output 0 when the absolute value of the difference between the converted or non-converted signal components of the pixel blocks  12   b  at the relatively same location of the SA and the CA 1  CA 8  is lower than a predetermined standard value. Also, the number of pixel blocks  12   b  outputting  1  by the arithmetical circuit may be counted as the likeness value. Incidentally, the predetermined standard value is 0 in the above first and second embodiments. 
         [0130]    The exclusive-or circuit is used in the above first and second embodiments to determine whether or not the signal components converted to binary values of the pixel blocks  12   b  in the SA, and those of CA 1 ˜CA 8  are similar to each other. Another arithmetical circuit, such as an exclusive-nor circuit, can be used for the purpose of this determination. 
         [0131]    The position of the focus lens  11   b  where an object is brought into focus is determined according to the contrast detection method, in the above first and second embodiments. However, the position of the focus lens  11   b  can be determined according to any other method, such as the phase difference detection method. 
         [0132]    The primary color filters, which are red, green, and blue filters, are mounted on the imaging device  12  in the above first and second embodiments. However, any other type of color filter, such as a complementary color filter, is adaptable. 
         [0133]    The pixels are arranged in a matrix within the ERA, in the above first and second embodiments. However, the arrangement of pixels is not restricted to a matrix and can be arranged in any two-dimensional pattern. 
         [0134]    The auto focus functions are carried out for the targeted object pursued by the pursuit block  30  in the above first and second embodiments. However, the pursuit function utilized by the pursuit block  30  to pursue the movement of the targeted object can be adapted to another function. For example, a monitoring camera can display a moving targeted object and a mark showing the targeted object by being adapted to the monitoring camera. Or the exposure adjustment can be automatically carried out for a moving targeted object. 
         [0135]    The pattern matching system is used for the pursuit function in the above first and second embodiments. However, the pattern matching system can be used for other functions, such as a face identification system. 
         [0136]    Although the embodiments of the present invention have been described herein with reference to the accompanying drawings, obviously many modifications and changes may be made by those skilled in this art without departing from the scope of the invention. 
         [0137]    The present disclosure relates to subject matter contained in Japanese Patent Application No. 2006-081218 (filed on Mar. 23, 2006), which is expressly incorporated herein, by reference, in its entirety.