Abstract:
According to the embodiments, there is provided an image processing apparatus including: an acquisition section configured to acquire 3×3 pixel block data to have one red pixel at a center; an estimation section configured to compute blue value differences between blue values of diagonal pairs of blue pixels in the block data, and to estimate a direction of a contrast boundary based on the blue value differences; and a processing section configured to compute a computed blue value based on the blue values of the four blue pixels within the block data according to the estimated direction of the contrast boundary, to compute a computed green value based on green values of two green pixels within the block data, and to output a color image pixel to have a red value of the red pixel and the computed blue and green values.

Description:
CROSS-REFERENCE TO RELATED APPLICATION(S) 
       [0001]    This application claims priority from Japanese Patent Application No. 2010-014270 filed on Jan. 26, 2010, the entire contents of which are incorporated herein by reference. 
       FIELD 
       [0002]    Embodiments described herein relate to an image processing apparatus and image processing method for performing demosaicing processing. 
       BACKGROUND 
       [0003]    For example, lane markings are provided for designating vehicle lanes on a road surface. There is known a lane marking recognition apparatus for recognizing such lane markings in an image of the road captured by a vehicle-installed forward-imaging camera (see, for example, JP-2007-018154-A). For example, a single solid-state image capture element which generates Bayer pattern array gray-scale image data (called RAW data) may be used as a vehicle-installed camera in a lane marking recognition apparatus. For the RAW data, demosaicing processing is performed to estimate/interpolate unavailable red values (R), green values (G) and blue values (B) for each pixel, thereby generating RGB color image data (see, for example, U.S. Pat. No. 5,506,619-B, U.S. Pat. No. 5,629,734-B and U.S. Pat. No. 5,652,621-B). Such demosaicing process will be performed in the image capture apparatus or in the following-stage image processing apparatus. The lane marking recognition apparatus of JP-2007-018154-A also includes image acquisition means for performing demosaicing processing on a video signal supplied from a color video camera. 
         [0004]    Recently Quad-VGA size (1280 pixel×960 pixel) and SXGA size (1280 pixel×1024 pixel) CMOS imaging sensors have become relatively low cost and are becoming more common that, for example, perform demosaicing processing on RAW data from a Quad-VGA size Bayer pattern array, reducing the frame size to VGA size (640 pixel×480 pixel). Such frame-size-reducing demosaicing processing is referred to below as resolution degradation demosaicing processing. 
         [0005]    Brief explanation follows regarding an example of related-art resolution degradation demosaicing processing.  FIGS. 7A and 7B  illustrate, respectively, base Bayer pattern array RAW data and primary RGB color image data resulting from resolution degradation demosaicing processing this RAW data. In  FIG. 7A , pixels R are red pixels, pixels B are blue pixels, and pixels Gr and pixels Gb are green pixels. The pixels Gr are located within R-pixel lines in the X direction (horizontal direction), and the pixels Gb are located within B-pixel lines in the X direction. In  FIG. 7A , the 2×2 pixel array containing the top-left pixel Gr, the top-right pixel R, the bottom-left pixel B and the bottom-right pixel Gb is a base pixel pattern. 
         [0006]    In  FIG. 78 , the pixels P ij  (where i and j are positive integers) are pixels after resolution degradation demosaicing processing. 
         [0007]    The pixel CP in  FIG. 7B  is the pixel for the base pixel pattern BP of  FIG. 7A  after resolution degradation demosaicing processing. In this resolution degradation demosaicing processing, for example, each of the values of the pixel R and the pixel B of the base pixel pattern BP is taken as the red value and blue value of the pixel CP, respectively, and the average value of the values of the pixel Gr and the pixel Gb of the base pixel pattern BP is taken as the green value of the pixel CP. 
         [0008]    Namely, by performing the resolution degradation demosaicing processing, reduced-size color image data is generated from the RAW data to be half the frame size in both the X direction and the Y direction. 
         [0009]    However, depending on the pattern of the image, false color is sometimes generated in the color image data after the resolution degradation demosaicing processing as described above. For example, in a lane marking recognition apparatus, image data of a road surface may be captured by an image capture apparatus, and the resolution degradation demosaicing processing may be performed on the captured image data. In this case, false yellow color will be generated in the color image data for the image patterns, as shown in  FIGS. 8A to 8C .  FIG. 8A  exemplarily illustrates a Bayer pattern array for a diagonal white line,  FIG. 8B  exemplarily illustrates a Bayer pattern array for a vertical white line, and  FIG. 8C  exemplarily illustrates a Bayer pattern array for a horizontal white line. In all cases, the brightness of pixels corresponding to the road surface other than at the white line is lower than the brightness of pixels corresponding to the white line. In such image pattern, when resolution degradation demosaicing processing is performed on a base pixel pattern having a large R pixel value and a small B pixel value, due to the red pixel R and the green pixel Gr/Gb, a yellow component that does not really exist is generated. Namely, false yellow color is generated. In each of the examples shown in  FIGS. 8A to 8C  a yellow line is generated at the edge portion of the white line (the portions inside the bold lines). 
         [0010]    Such false yellow color can also be generated by portions where white lines on the road surface are wearing/flaking or cracks have developed in the white lines due to the passage of vehicles. False yellow color also readily occurs around edges of the bodies of white vehicles traveling on the road. 
         [0011]    There are also other lane markings on the road surface in addition to white lines, such as yellow lines, transverse lines, Bott&#39;s dots, and cat&#39;s eyes. Bott&#39;s dots are circular plates of about 10 cm diameter with a raised height of 1 cm, and plural Bott&#39;s dots are provided on vehicle lane dividing lines or on hypothetical lines where vehicle lanes should be divided. Cat&#39;s eyes are substantially rectangular shaped reflective bodies, with plural cat&#39;s eyes provided for dividing vehicle lanes. 
         [0012]    When a lane marking recognition apparatus employs color image data generated by the related-art resolution degradation demosaicing processing for recognizing lane markings, false yellow color may be present in the color image data, and false-positive recognition and/or a degradation in lane marking detection precision may occur. 
       SUMMARY 
       [0013]    According to the embodiments described herein, there is provided an image processing apparatus and an image processing method with resolution degradation demosaicing processing that effectively suppresses generation of false yellow color. 
         [0014]    According to a first aspect of the embodiments, there is provided an image processing apparatus including: a block data acquisition section configured to receive image data in which rows of alternately disposed blue pixels and green pixels and rows of alternately disposed green pixels and red pixels are alternately disposed along a column direction, and to acquire 3×3 pixel block data from the image data to have one red pixel positioned at a center, four blue pixels positioned at corners and four green pixels positioned respectively at above/below/left/right portions of the center; a contrast boundary estimation section configured to compute blue value differences between blue values of diagonal pairs of the blue pixels in the block data, and to estimate a direction of a contrast boundary in the block data based on the blue value differences; and a pixel interpolation processing section configured to compute a computed blue value based on the blue values of the four blue pixels within the block date according to the estimated direction of the contrast boundary, to compute a computed green value based on green values of two green pixels within a 2×2 pixel pattern contained in the block data, and to output a color image pixel correspondingly with the pixel pattern to have (1) a red value of the red pixel, (2) the computed blue value and (3) the computed green value. 
         [0015]    According to a second aspect of the embodiments, there is provided an image processing apparatus including: a block data acquisition section configured to receive image data in which rows of alternately disposed blue pixels and green pixels and rows of alternately disposed green pixels and red pixels are alternately disposed along a column direction, and to acquire 3×3 pixel block data from the image data to have one blue pixel positioned at a center, four red pixels positioned at corners and four green pixels positioned respectively at above/below/left/right portions of the center; a contrast boundary estimation section configured to compute red value differences between red values of diagonal pairs of the red pixels in the block data, and to estimate a direction of a contrast boundary in the block data based on the red value differences; and a pixel interpolation processing section configured to compute a computed red value based on the red values of the four red pixels within the block data according to the estimated direction of the contrast boundary, to compute a computed green value based on green values of two green pixels within a 2×2 pixel pattern contained in the block data, and to output a color image pixel correspondingly with the pixel pattern to have (1) a blue value of the blue pixel, (2) the computed red value and (3) the computed green value. 
         [0016]    According to a third aspect of the embodiments, there may be provided the image processing apparatus, wherein the contrast boundary estimation section computes green value differences between the green values of vertical and horizontal pairs of the green pixels in the block data, wherein the contrast boundary estimation section estimates a first contrast boundary direction from the blue difference values and a second contrast boundary direction from the green difference values, and wherein the pixel interpolation processing section computes the computed blue value based on the blue values of the four blue pixels within the block data according to the first contrast boundary direction, and computes the computed green value based on the green values of the two green pixels within the pixel pattern according to the second contrast boundary direction. 
         [0017]    According to a fourth aspect of the embodiments, there may be provided the image processing apparatus, wherein the contrast boundary estimation section computes green value differences between the green values of vertical and horizontal pairs of the green pixels in the block data, wherein the contrast boundary estimation section estimates a first contrast boundary direction from the blue difference values and a second contrast boundary direction from the green difference values, and wherein the pixel interpolation processing section computes the computed green value based on the green values of the horizontal pair of the green pixels within the 3×3 pixel data block while weighting the green value of the green pixel within the 2×2 pixel pattern when the second contrast boundary direction is estimated to be in a horizontal direction, and computes the computed green value based on the green values of the vertical pair of the green pixels within the 3×3 pixel data block while weighting the green value of the green pixel within the 2×2 pixel pattern when the second contrast boundary direction is estimated to be in a vertical direction. 
         [0018]    According to a fifth aspect of the embodiments, there may be provided the image processing apparatus, wherein the contrast boundary estimation section computes green value differences between the green values of vertical and horizontal pairs of the green pixels in the block data, wherein the contrast boundary estimation section estimates a first contrast boundary direction from the red difference values and a second contrast boundary direction from the green difference values, and wherein the pixel interpolation processing section computes the computed red value based on the red values of the four red pixels within the block data according to the first contrast boundary direction, and computes the computed green value based on the green values of the two green pixels within the pixel pattern according to the second contrast boundary direction. 
         [0019]    According to a sixth aspect of the embodiments, there may be provided the image processing apparatus, wherein the contrast boundary estimation section computes green value differences between the green values of vertical and horizontal pairs of the green pixels in the block data, wherein the contrast boundary estimation section estimates a first contrast boundary direction from the red difference values and a second contrast boundary direction from the green difference values, and wherein the pixel interpolation processing section computes the computed green value based on the green values of the horizontal pair of the green pixels within the 3×3 pixel data block while weighting the green value of the green pixel within the 2×2 pixel pattern when the second contrast boundary direction is estimated to be in a horizontal direction, and computes the computed green value based on the green values of the vertical pair of the green pixels within the 3×3 pixel data block while weighting the green value of the green pixel within the 2×2 pixel pattern when the second contrast boundary direction is estimated to be in a vertical direction. 
         [0020]    According to a seventh aspect of the embodiments, there is provided an image processing method including: receiving image data in which rows of alternately disposed blue pixels and green pixels and rows of alternately disposed green pixels and red pixels are alternately disposed along a column direction; acquiring 3×3 pixel block data from the image data to have one red pixel positioned at a center, four blue pixels positioned at corners and four green pixels positioned respectively at above/below/left/right portions of the center; computing blue value differences between blue values of diagonal pairs of the blue pixels in the block data; estimating a direction of a contrast boundary in the block data based on the blue value differences; computing a computed blue value based on the blue values of the four blue pixels within the block data according to the estimated direction of the contrast boundary; computing a computed green value based on green values of two green pixels within a 2×2 pixel pattern contained in the block data; and outputting a color image pixel correspondingly with the pixel pattern to have (1) a red value of the red pixel, (2) the computed blue value and (3) the computed green value. 
         [0021]    According to an eighth aspect of the embodiments, there is provided an image processing method including: receiving image data in which rows of alternately disposed blue pixels and green pixels and rows of alternately disposed green pixels and red pixels are alternately disposed along a column direction; acquiring 3×3 pixel block data from the image data to have one blue pixel positioned at a center, four red pixels positioned at corners and four green pixels positioned respectively at above/below/left/right portions of the center; computing red value differences between red values of diagonal pairs of the red pixels in the block data; estimating a direction of a contrast boundary in the block data based on the red value differences; computing a computed red value based on the red values of the four red pixels within the block data according to the estimated direction of the contrast boundary; computing a computed green value based on green values of two green pixels within a 2×2 pixel pattern contained in the block data; and outputting a color image pixel correspondingly with the pixel pattern to have (1) a blue value of the blue pixel, (2) the computed red value and (3) the computed green value. 
         [0022]    According to embodiments described herein, false yellow color can be efficiently suppressed from occurring in resolution degradation demosaicing processing. 
     
    
     
       BRIEF DESCRIPTION OF DRAWINGS 
         [0023]      FIG. 1  illustrates a functional configuration of an image recognition system including an image recognition apparatus applied to an image processing apparatus in a first embodiment to a fourth embodiment. 
           [0024]      FIG. 2  illustrates the way in which Bayer pattern array RAW data is split into 3×3 pixel block data in the first embodiment and the third embodiment. 
           [0025]      FIG. 3  illustrates 3×3 pixel block data pixel configuration in the first embodiment and the third embodiment. 
           [0026]      FIG. 4  illustrates a processing sequence of a demosaicing processing section in the first embodiment to the fourth embodiment. 
           [0027]      FIG. 5  illustrates the way in which Bayer pattern array RAW data is split into 3×3 pixel block data in the second embodiment and the fourth embodiment. 
           [0028]      FIG. 6  illustrates 3×3 pixel block data pixel configuration in the second embodiment and the fourth embodiment. 
           [0029]      FIGS. 7A and 7B  illustrate base Bayer pattern array RAW data and primary RGB color image data derived by subjecting the RAW data to resolution degradation demosaicing processing. 
           [0030]      FIGS. 8A to 8C  illustrate false yellow color generation in color image data. 
       
    
    
     DETAILED DESCRIPTION 
       [0031]    Embodiments will be described in detail with reference to the drawings. 
       First Embodiment 
       [0032]      FIG. 1  illustrates a functional configuration of an image recognition system including an image recognition apparatus applied as an image processing apparatus of a first embodiment. In  FIG. 1 , an image recognition system  1  includes an image capture apparatus  10  and an image recognition apparatus  20 . 
         [0033]    The image capture apparatus  10  is a digital camera disposed on a vehicle so as to be capable of forward capture of an image of the road surface on which the vehicle is traveling. The image capture apparatus  10  includes a single solid-state image capture element. The image capture element is, for example, a CMOS imaging sensor. The image capture element captures an image of the imaging subject focused through an image capture lens and generates image capture data, this being RAW data of a Quad-VGA size Bayer pattern array. In the present embodiment, the RAW data Bayer pattern array has a pixel array as shown in  FIG. 7A . Namely, in the RAW data, a pixel array has rows of alternately disposed pixels B and pixels Gb and rows of alternately disposed pixels Gr and pixels R, and these respective rows are alternately disposed along a column direction. RAW data is generated in the image capture apparatus  10  at a specific frame rate (for example 15 frames/second) and supplied to the image recognition apparatus  20 . 
         [0034]    The image recognition apparatus  20  serially imports the RAW data supplied from the image capture apparatus  10 , performs resolution degeneration demosaicing processing to generate, for example, VGA size color image data, and detects for lane markings in the color image data, such as white lines, yellow lines, transverse lines, Bott&#39;s dots and cat&#39;s eyes. 
         [0035]    As shown in  FIG. 1 , the image recognition apparatus  20  includes a captured image data importing section  21 , a captured image data storage section  22 , a demosaicing processing section  23 , a color image data storage section  24  and an image recognition processing section  25 . 
         [0036]    The captured image data importing section  21  imports RAW data supplied from the image capture apparatus  10  and stores the RAW data in the captured image data storage section  22 . 
         [0037]    The captured image data storage section  22  is Random Access Memory (RAM) for storing 4, lines worth of RAW data or more, for example a line memory. 
         [0038]    The demosaicing processing section  23  reads the RAW data stored in the captured image data storage section  22 , reduces the frame size and performs demosaicing processing according to the contrast boundaries of the image to generate color image data, and stores the color image data in the color image data storage section  29 . The image processing apparatus of the present embodiment includes the demosaicing processing section  23  of the image recognition apparatus  20 . In the present embodiment, the demosaicing processing section  23  generates VGA size color image data from the Quad-VGA size Bayer pattern array RAW data. 
         [0039]    The demosaicing processing section  23  is, for example, configured by a Central Processor Unit (CPU), and by reading and executing a demosaicing processing program stored in a non-illustrated memory, the demosaicing processing section  23  has a functional configuration including a block data acquisition section  23   a , a contrast boundary estimation section  23   b  and an pixel interpolation processing section  23   c.    
         [0040]    The block data acquisition section  23   a  reads 3×3 pixel block data containing a single individual base pixel pattern (2×2) from the RAW data stored in the captured image data storage section  22 . Detailed explanation is given later regarding the block data pixel configuration. 
         [0041]    On receipt of the block data supplied from the block data acquisition section  23   a , the contrast boundary estimation section  23   b  analysis the density in the block data and estimates a direction of a contrast boundary. 
         [0042]    The pixel interpolation processing section  23   c  interpolates pixels of the base pixel pattern contained in the block data according to the block data contrast boundary direction estimated by the contrast boundary estimation section  23   b , generates 1-pixel&#39;s worth of color image data and stores the color image data in the color image data storage section  24 . 
         [0043]    The color image data storage section  24  is RAM for storing 4 lines worth of color image data or more, for example a line memory. 
         [0044]    The image recognition processing section  25  reads the color image data stored in the color image data storage section  24 , and detects for lane markings included in the color image data. The image recognition processing section  25  detects for lane markings by performing known pattern matching processing that searches for objects matching the shape and color of various lane markings pre-stored as color image data. 
         [0045]    Explanation now follows regarding the 3×3 pixel block data pixel configuration.  FIG. 2  illustrates the way in which Bayer pattern array RAW data is split into 3×3 pixel block data in the present embodiment. As shown in  FIG. 2 , the block data acquisition section  23   a  of the demosaicing processing section  23  reads 3×3 pixel block data from the RAW data stored in the captured image data storage section  22 , in the sequence block data BD  11 , BD  12 , BD  13 , BD  14  and so on. After reading along the X direction up to the top right corner of the image, the block data acquisition section  23   a  then reads 3×3 pixel block data from the RAW data in the sequence block data BD  21 , BD  22 , BD  23 , BD  24  and so on. The block data acquisition section  23   a  performs demosaicing processing while reading 3×3 pixel block data from the RAW data in such a sequence. 
         [0046]      FIG. 3  illustrates 3×3 pixel block data pixel configuration. As shown in  FIG. 3 , the block data BD includes a red pixel R 22 , blue pixels B 11 , B 13 , B 31 , B 33 , and green pixels Gb 12 , Gb 32 , Gr 21 , Gr 23 . The numerical suffixes appended to each of the symbols representing each of the pixels express the position of the respective pixels. The block data BD contains a single 2×2 pixel base pixel pattern BP. The base pixel pattern BP contains, for example, top-left pixel Gr 21 , top-right pixel R 22 , bottom-left pixel B 31  at the bottom left and bottom-right pixel Gb 32 . Namely, the base pixel pattern BP contains the pixel R 22  at the center of the block data BD. 
         [0047]    In the present embodiment, the demosaicing processing section  23  estimates a direction of a contrast boundary using the 4 individual blue pixels B 11 , B 13 , B 31 , B 33  contained in the block data BD, and computes a blue value corresponding to pixel R 22  of the base pixel pattern BP based on the pixels B 11 , B 13 , B 31 , B 33  according to the estimated contrast boundary direction. The computed blue value is used as the blue value of resolution degradation demosaicing processing. 
         [0048]    Explanation now follows regarding operation of the demosaicing processing section  23  according to the present embodiment.  FIG. 4  illustrates the processing sequence of the demosaicing processing section  23 . When at least 3 lines worth of RAW data has been stored in the captured image data storage section  22 , the demosaicing processing section  23  starts the processing illustrated in  FIG. 4 . 
         [0049]    At step S 41 , the block data acquisition section  23   a  of the demosaicing processing section  23  reads a single individual block data BD from the RAW data stored in the captured image data storage section  22 . 
         [0050]    At step S 42 , the contrast boundary estimation section  23   b  estimates the contrast boundary direction using the 4 individual blue pixels B 11 , B 13 , B 31 , B 33  contained in the read block data BD. 
         [0051]    Specifically, the contrast boundary estimation section  23   b  computes a blue difference value ΔB RD  between the pixel B 11  and the pixel B 33 , and a blue difference value ΔB LD  between pixel B 13  and pixel B 31 , according Equation (1) and Equation (2) 
         [0000]      Δ B   RD   =|B   11   −B   33 |  Equation (1)
 
         [0000]      Δ B   LD   =|B   13   −B   31 |  Equation (2)
 
         [0052]    The contrast boundary estimation section  23   b  then compares the difference value ΔB RD  and the difference value ΔB LD , and the contrast boundary direction in the block data BD is estimated to be along the direction sloping down to the left when determined that the difference value ΔB RD  is greater than the difference value ΔB LD , the contrast boundary direction of the block data BD is estimated to be along the direction sloping down to the right when determined that the difference value ΔB RD  is less than the difference value ΔB LD , and there is estimated to be no contrast boundary direction in the block data BD when the difference value ΔB RD  is equivalent to the difference value ΔB LD . 
         [0053]    At step S 43 , the pixel interpolation processing section  23   c  computes the blue value B 22 (hat) of the pixel R 22  of the base pixel pattern BP based on the pixels B 11 , B 13 , B 31 , B 33  according to the estimation result of the contrast boundary estimation section  23   b , and the green value G 22 (hat) of the pixel R 22  based on the pixel Gr 21  and the pixel Gb 32  of the base pixel pattern BP. Note that “(hat)” indicates that preceding value is an estimated value. 
         [0054]    Specifically, when the pixel interpolation processing section  23   c  has estimated the contrast boundary direction is sloping down to the left then the blue value B 22 (hat) of the pixel R 22  is computed according to Equation (3), when the contrast boundary direction is estimated to be sloping down to the right then the blue value B 22 (hat) of the pixel R 22  is computed according to Equation (4), and when there is no contrast boundary direction estimated then the blue value B 22 (hat) of the pixel R 22  is computed according to Equation (5). 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       B 
                       ⋒ 
                     
                     22 
                   
                   = 
                   
                     
                       
                         B 
                         13 
                       
                       + 
                       
                         B 
                         31 
                       
                     
                     2 
                   
                 
               
               
                 
                   Equation 
                    
                   
                       
                   
                    
                   
                     ( 
                     3 
                     ) 
                   
                 
               
             
             
               
                 
                   
                     
                       B 
                       ⋒ 
                     
                     22 
                   
                   = 
                   
                     
                       
                         B 
                         11 
                       
                       + 
                       
                         B 
                         33 
                       
                     
                     2 
                   
                 
               
               
                 
                   Equation 
                    
                   
                       
                   
                    
                   
                     ( 
                     4 
                     ) 
                   
                 
               
             
             
               
                 
                   
                     
                       B 
                       ⋒ 
                     
                     22 
                   
                   = 
                   
                     
                       
                         B 
                         11 
                       
                       + 
                       
                         B 
                         13 
                       
                       + 
                       
                         B 
                         31 
                       
                       + 
                       
                         B 
                         33 
                       
                     
                     4 
                   
                 
               
               
                 
                   Equation 
                    
                   
                       
                   
                    
                   
                     ( 
                     5 
                     ) 
                   
                 
               
             
           
         
       
     
         [0055]    The pixel interpolation processing section  23   c  computes the green value G 22 (hat) of the pixel R 22  according to Equation (6). 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       G 
                       ⋒ 
                     
                     22 
                   
                   = 
                   
                     
                       
                         Gr 
                         21 
                       
                       + 
                       
                         Gb 
                         32 
                       
                     
                     2 
                   
                 
               
               
                 
                   Equation 
                    
                   
                       
                   
                    
                   
                     ( 
                     6 
                     ) 
                   
                 
               
             
           
         
       
     
         [0056]    The pixel interpolation processing section  23   c  stores the red value of the pixel R 22 , the computed blue value B 22 (hat) of the pixel R 22 , and the computed green value G 22 (hat) of the pixel R 22  in the color image data storage section  24  as the pixel values after resolution degradation demosaicing. 
         [0057]    At step S 44 , the demosaicing processing section  23  determines whether or not another block data BD exists for processing next in the RAW data being processed. When determined that there is another block data BD for processing (S 44 : YES), processing proceeds to step S 41 , however the processing is ended when determined that no further block data BD for processing exists (S 44 :NO). 
         [0058]    For pixels in the RAW data not contained in the 3×3 pixel block data BD (for example, the RAW data frame edge portions), as shown in  FIG. 2 , color image data for pixels CP are derived from the base pixel patterns BP by resolution degradation demosaicing processing of a related-art technique, as shown in  FIGS. 7A and 7B . 
         [0059]    That is, the pixel R value and the pixel B value of the base pixel pattern BP are taken as the red value and the blue value of the pixel CP, respectively, and the average value of the pixel Gr and the pixel Gb of the base pixel pattern BP is taken as the green value of the pixel CP. 
         [0060]    As explained above, in the present embodiment, the demosaicing processing section  23  does not apply the blue value from the pixel B 31  of the base pixel pattern BP as the blue value for the pixel R 22  of the base pixel pattern BP. Rather, the demosaicing processing section  23  estimates the contrast boundary direction of the image based on the blue pixels B 11 , B 13 , B 31 , B 33  in the 3×3 pixel block data BD containing the base pixel pattern BP. Consequently, according to the demosaicing processing section  23  of the present embodiment, false yellow coloring at the contrast boundary portions of the image can be suppressed from occurring. Namely, since the demosaicing processing section  23  has a tendency to compute a lower blue value at the pixel R 22  of the base pixel pattern BP, this shifts in the blue-green color system at the contrast boundary portions where false color readily occurs for the color pixel data as a whole. 
         [0061]    Consequently, in the image recognition apparatus of the present embodiment, since false yellow coloring does not readily occur in the color image data from resolution degradation demosaicing processing the Bayer pattern array RAW data with reduced frame size, false detection of lane markings can be suppressed while maintaining a high detection precision of lane markings with the image recognition processing section  25 . 
       Second Embodiment 
       [0062]    A second embodiment differs in the processing of the demosaicing processing section  23  from that of the image recognition system  1  of the first embodiment. The demosaicing processing section  23  of the present embodiment will be mainly explained. Since the functional configuration of the demosaicing processing section  23  is similar to that of the first embodiment, further explanation thereof will be omitted. 
         [0063]      FIG. 5  illustrates the way in which Bayer pattern array RAW data is split into 3×3 pixel block data in the present embodiment. As shown in  FIG. 5 , the block data acquisition section  23   a  of the demosaicing processing section  23  reads 3×3 pixel block data from the RAW data stored in the captured image data storage section  22 , in the sequence block data BD  11 , BD  12 , BD  13 , BD  14  and so on. After reading along the X direction up to the top right corner of the image, the block data acquisition section  23   a  then reads 3×3 pixel block data from the RAW data in the sequence block data BD  21 , BD  22 , BD  23 , BD  24  and so on. The block data acquisition section  23   a  performs demosaicing processing while reading 3×3 pixel block data from the RAW data in such a sequence. 
         [0064]      FIG. 6  illustrates 3×3 pixel block data pixel configuration. As shown in  FIG. 6 , the block data BDa includes a blue pixel B 22 , red pixels R 11 , R 13 , R 31 , R 33 , and green pixels Gr 12 , Gb 21 , Gb 23 , Gr 32 . The numerical suffixes appended to each of the symbols representing each of the pixels express the position of the respective pixels. The block data BDa includes a single 2×2 pixel base pixel pattern BP. The base pixel pattern BP contains, for example, top-left pixel Gr 12 , top-right pixel R 13 , bottom-left pixel B 22  and bottom-right pixel Gb 23 . Namely, the base pixel pattern BP contains the pixel B 22  at the center of the block data BDa. 
         [0065]    In the present embodiment, the demosaicing processing section  23  estimates a direction of a contrast boundary using the 4 individual red pixels R 11 , R 13 , R 31 , R 33  contained in the block data BDa, and computes a red value corresponding to pixel B 22  of the base pixel pattern BP based on the red pixels R 11 , R 13 , R 31 , R 33  according to the estimated contrast boundary direction. The computed red value is used as the red value of resolution degradation demosaicing processing. 
         [0066]    Explanation now follows regarding operation of the demosaicing processing section  23  according to the present embodiment. Since the processing sequence of the demosaicing processing section  23  is the same as illustrated in  FIG. 4 , explanation is based on the same figure. When at least 3 lines worth of RAW data has been stored in the captured image data storage section  22 , the demosaicing processing section  23  starts the processing illustrated in  FIG. 4 . 
         [0067]    At step S 41 , the block data acquisition section  23   a  of the demosaicing processing section  23  reads a single individual block data BDa from the RAW data stored in the captured image data storage section  22 . 
         [0068]    At step S 42 , the contrast boundary estimation section  23   b  estimates the contrast boundary direction using the 4 individual red pixels R 11 , R 13 , R 31 , R 33  contained in the read block data BDa. 
         [0069]    Specifically, the contrast boundary estimation section  23   b  computes a red difference value ΔR RD  between the pixel R 11  and the pixel R 33 , and a red difference value ΔR LD  between pixel R 13  and pixel R 31 , according to Equation (7) and Equation (8). 
         [0000]      Δ R   RD   =|R   11   −R   33 |  Equation (7)
 
         [0000]      Δ R   LD   =|R   13   −R   31 |  Equation (8)
 
         [0070]    The contrast boundary estimation section  23   b  then compares the difference value ΔR RD  and the difference value ΔR LD , and the contrast boundary direction in the block data BDa is estimated to be along the direction sloping down to the left when determined that the difference value ΔR RD  is greater than the difference value ΔR LD , the contrast boundary direction of the block data BDa is estimated to be along the direction sloping down to the right when determined that the difference value ΔR RD  is less than the difference value ΔR LD , and there is estimated to be no contrast boundary direction in the block data BDa when the difference value ΔR RD  is equivalent to the difference value ΔR LD . 
         [0071]    At step S 43 , the pixel interpolation processing section  23   c  computes the red value R 22  (hat) of the pixel B 22  of the base pixel pattern BP based on the pixels R 11 , R 13 , R 31 , R 33  according to the estimation result of the contrast boundary estimation section  23   b , and the green value G 22  (hat) of the pixel B 22  based on the pixel Gr 12  and the pixel Gb 23  of the base pixel pattern BP. 
         [0072]    Specifically, when the pixel interpolation processing section  23   c  has estimated the contrast boundary direction is sloping down to the left then the red value R 22 (hat) of the pixel B 22  is computed according to Equation (9), when the contrast boundary direction is estimated to be sloping down to the right then the red value R 22 (hat) of the pixel B 22  is computed according to Equation (10), and when there is no contrast boundary direction estimated then the red value R 22 (hat) of the pixel B 22  is computed according to Equation (11). 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       R 
                       ⋒ 
                     
                     22 
                   
                   = 
                   
                     
                       
                         R 
                         13 
                       
                       + 
                       
                         R 
                         31 
                       
                     
                     2 
                   
                 
               
               
                 
                   Equation 
                    
                   
                       
                   
                    
                   
                     ( 
                     9 
                     ) 
                   
                 
               
             
             
               
                 
                   
                     
                       R 
                       ⋒ 
                     
                     22 
                   
                   = 
                   
                     
                       
                         R 
                         11 
                       
                       + 
                       
                         R 
                         33 
                       
                     
                     2 
                   
                 
               
               
                 
                   Equation 
                    
                   
                       
                   
                    
                   
                     ( 
                     10 
                     ) 
                   
                 
               
             
             
               
                 
                   
                     
                       R 
                       ⋒ 
                     
                     22 
                   
                   = 
                   
                     
                       
                         R 
                         11 
                       
                       + 
                       
                         R 
                         13 
                       
                       + 
                       
                         R 
                         31 
                       
                       + 
                       
                         R 
                         33 
                       
                     
                     4 
                   
                 
               
               
                 
                   Equation 
                    
                   
                       
                   
                    
                   
                     ( 
                     11 
                     ) 
                   
                 
               
             
           
         
       
     
         [0073]    The pixel interpolation processing section  23   c  computes the green value G 22 (hat) of the pixel B 22  according to Equation (12). 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       G 
                       ⋒ 
                     
                     22 
                   
                   = 
                   
                     
                       
                         Gr 
                         12 
                       
                       + 
                       
                         Gb 
                         23 
                       
                     
                     2 
                   
                 
               
               
                 
                   Equation 
                    
                   
                       
                   
                    
                   
                     ( 
                     12 
                     ) 
                   
                 
               
             
           
         
       
     
         [0074]    The pixel interpolation processing section  23   c  stores the red value of the pixel B 22 , the computed red value R 22 (hat) of the pixel B 22 , and the computed green value G 22 (hat) of the pixel B 22  in the color image data storage section  24  as the pixel values after resolution degradation demosaicing. 
         [0075]    At step S 99 , the demosaicing processing section  23  determines whether or not another block data BDa exists for processing next in the RAW data being processed. When determined that there is another block data BDa for processing (S 44 : YES), processing proceeds to step S 41 , however the processing is ended when determined that no further block data BDa for processing exists (S 44 :NO). 
         [0076]    Note that, as shown in  FIG. 5 , for pixels in the RAW data not contained in the 3×3 pixel block data BDa (for example, the RAW data frame edge portions), color image data for pixels CP are derived from the base pixel pattern BP by resolution degradation demosaicing processing of a related-art technique, as shown in  FIGS. 7A and 7B . 
         [0077]    That is, the pixel R value and pixel B value of the base pixel pattern BP are taken as the red value and the blue value of the pixel CP, respectively, and the average of the pixel Gr value and the pixel Gb value of the base pixel pattern BP is taken as the green value of the pixel CP. 
         [0078]    As explained above, in the present embodiment, the demosaicing processing section  23  does not apply the red value from the pixel R 13  of the base pixel pattern BP as the red value for the pixel B 22  of the base pixel pattern BP, but instead estimates the contrast boundary direction of the image based on the red pixels R 11 , R 13 , R 31 , R 33  in the 3×3 pixel block data BDa containing the base pixel pattern BP. Consequently, according to the demosaicing processing section  23  of the present embodiment, false yellow coloring at the contrast boundary portions of the image can be suppressed from occurring. Namely, since the demosaicing processing section  23  tends to compute a lower red value at the pixel B 22  of the base pixel pattern BP, this shifts in the red-yellow color system at the contrast boundary portions where false color readily occurs for the color pixel data as a whole. 
         [0079]    Consequently, in the image recognition apparatus of the present embodiment, since false yellow coloring does not readily occur in the color image data from resolution degradation demosaicing processing the Bayer pattern array RAW data with reduced frame size, false detection of lane markings can be suppressed while maintaining a high detection precision of lane markings with the image recognition processing section  25 . 
       Third Embodiment 
       [0080]    A third embodiment differs in the processing of the demosaicing processing section  23  from that of the image recognition system  1  of the first embodiment. In the first embodiment, the pixel interpolation processing section  23   c  of the demosaicing processing section  23  computes the green value G 22 (hat) of the pixel R 22  according to Equation (6). Namely, in the first embodiment, the pixel interpolation processing section  23   c  takes the average value of pixel Gr 21  and pixel Gb 32  as the green value G 22 (hat) of the pixel R 22 . 
         [0081]    However, in the present embodiment, the contrast boundary estimation section  23   b  estimates the contrast boundary direction using the 4 individual green pixels Gb 12 , Gb 32 , Gr 21 , Gr 23  contained in the block data BD. The green value G 22 (hat) of the pixel R 22  of the base pixel pattern BP is then computed based on the pixels Gr 21 , Gb 32  according to the estimated contrast boundary direction. This computed green value G 22 (hat) is then used for the green value of resolution degradation demosaicing. 
         [0082]    The demosaicing processing section  23  of the present embodiment will be mainly explained. Since the functional configuration of the demosaicing processing section  23  is similar to that of the first embodiment, further explanation thereof will be omitted. 
         [0083]    Explanation now follows regarding operation of the demosaicing processing section  23  according to the present embodiment. Since the processing sequence of the demosaicing processing section  23  is the same as illustrated in  FIG. 4 , explanation is based on the same figure. Processing steps that are the same as processing in the first embodiment will be omitted, and explanation only given of the steps with different processing. 
         [0084]    At step S 42 , the contrast boundary estimation section  23   b  estimates a first contrast boundary direction using the 4 individual blue pixels B 11 , B 13 , B 31 , B 33  contained in the block data BD that has been read, and subsequently estimates a second contrast boundary direction using the 4 individual green pixels Gb 12 , Gb 32 , Gr 21 , Gr 23 . 
         [0085]    Specifically, estimation of the first contrast boundary direction is performed using the estimation method of the contrast boundary direction by computation according to Equation (1) and Equation (2) of the first embodiment. 
         [0086]    Estimation of the second contrast boundary direction is as follows. The contrast boundary estimation section  23   b  computes a green difference value ΔG y  between the pixel Gb 12  and the pixel Gb 32  and a green difference value ΔG H  between the pixel Gr 21  and the pixel Gr 23  according to Equation (13) and Equation (14). 
         [0000]      Δ G   V   =|Gr   12   −Gr   32 |  Equation (13)
 
         [0000]      Δ G   H   =|Gb   21   −Gb   23 |  Equation (14)
 
         [0087]    The contrast boundary estimation section  23   b  then compares the difference value ΔG V  and the difference value ΔG H , and the second contrast boundary direction in the block data BD is estimated to be in the horizontal direction when determined that the difference value ΔG V  is greater than the difference value ΔG H , the second contrast boundary direction of the block data BD is estimated to be in the vertical direction when determined that the difference value ΔG V  is less than the difference value ΔG H , and there is estimated to be no second contrast boundary direction in the block data BD when the difference value ΔG V  is equivalent to the difference value ΔG H . 
         [0088]    At step S 43 , the pixel interpolation processing section  23   c  computes the blue value B 22 (hat) of the pixel R 22  of the base pixel pattern BP based on the pixels B 11 , B 13 , B 31 , B 33  according to the estimation result of the first contrast boundary direction by the contrast boundary estimation section  23   b , and subsequently computes the green value G 22 (hat) of the pixel R 22  based on the pixels Gr 21 , Gb 32  according to the estimation result of the second contrast boundary direction by the contrast boundary estimation section  23   b.    
         [0089]    Specifically, computation of the blue value B 22 (hat) of the pixel R 22  is the same as the computation in the first embodiment. 
         [0090]    Computation of the green value G 22 (hat) of the pixel R 22  is as follows. The pixel interpolation processing section  23   c  applies the green pixel Gr 21  of the base pixel pattern BP as the green value G 22 (hat) of the pixel R 22  when the second contrast boundary direction is estimated to be in the horizontal direction, and applies the green pixel Gb 32  of the base pixel pattern BP as the green value G 22 (hat) of the pixel R 22  when the second contrast boundary direction is estimated to be in the vertical direction. When there is estimated to be no second contrast boundary direction then the green value G 22 (hat) of the pixel R 22  is computed according to above Equation (6). 
         [0091]    The pixel interpolation processing section  23   c  stores the red value of the pixel R 22 , the computed blue value B 22 (hat) of the pixel R 22 , and the computed green value G 22 (hat) of the pixel R 22  in the color image data storage section  24  as the pixel values after resolution degradation demosaicing. 
         [0092]    As explained above, in the present embodiment, in addition to the processing of the first embodiment, the demosaicing processing section  23  does not take the average value of the pixel Gr 21  and pixel Gb 32  of the base pixel pattern BP as the green value of the pixel R 22  of the base pixel pattern BP, but instead estimates the contrast boundary direction of the image based on the green pixels Gb 12 , Gb 32 , Gr 21 , Gr 23  in the 3×3 pixel block data BD containing the base pixel pattern BP. Consequently, according to the demosaicing processing section  23  of the present embodiment, false yellow coloring at the contrast boundary portions of the image can be even more efficiently suppressed from occurring than in the first embodiment. 
         [0093]    Consequently, in the image recognition apparatus of the present embodiment, since false yellow coloring does not readily occur in the color image data from resolution degradation demosaicing processing the Bayer pattern array RAW data with reduced frame size, false-positive detection of lane markings can be suppressed while maintaining a high detection precision of lane markings with the image recognition processing section  25 . 
       Modification of Third Embodiment 
       [0094]    In the above third embodiment the pixel interpolation processing section  23   c  of the demosaicing processing section  23  computes the green value G 22 (hat) of the pixel R 22  based on the pixels Gr 21 , Gb 23  according to the estimation result of the second contrast boundary direction by the contrast boundary estimation section  23   b.    
         [0095]    However, in this modification, the contrast boundary estimation section  23   b  estimates a contrast boundary direction using the 4 individual green pixels Gb 12 , Gb 32 , Gr 21 , Gr 23  contained in the block data BD. The green value G 22 (hat) of the pixel R 22  of the base pixel pattern BP is then computed based on the pixels Gb 12 , Gb 32 , Gr 21 , Gr 23  according to the estimated contrast boundary direction, and this computed green value G 22 (hat) is employed as the green value in the resolution degradation demosaicing. Only the elements of the present modification that differ from the third embodiment will be explained. 
         [0096]    In this modification, the computation sequence of step S 43  differs from the processing sequence of the demosaicing processing section  23  in the third embodiment. Namely, at step S 43 , the pixel interpolation processing section  23   c  computes the blue value B 22 (hat) of the pixel R 22  of the base pixel pattern BP based on the pixels B 11 , B 13 , B 31 , B 33  according to the estimation result of the first contrast boundary direction by the contrast boundary estimation section  23   b . The pixel interpolation processing section  23   c  then computes the green value G 22 (hat) of the pixel R 22  based on the pixels Gb 12 , Gb 32 , Gr 21 , Gr 23  according to the estimation result of the second contrast boundary direction by the contrast boundary estimation section  23   b.    
         [0097]    Specifically, computation of the green value G 22 (hat) of the pixel R 22  is as follows. The pixel interpolation processing section  23   c  computes the green value G 22 (hat) of the pixel R 22  according to Equation (15) when the second contrast boundary direction is estimated to be in the horizontal direction, and computes the green value G 22 (hat) of the pixel R 22  according to Equation (16) when the second contrast boundary direction is estimated to be in the vertical direction. When there is estimated to be no second contrast boundary the green value G 22 (hat) of the pixel R 22  is estimated according to Equation (17). 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       G 
                       ⋒ 
                     
                     22 
                   
                   = 
                   
                     
                       
                         3 
                         × 
                         
                           Gr 
                           21 
                         
                       
                       + 
                       
                         Gr 
                         23 
                       
                     
                     4 
                   
                 
               
               
                 
                   Equation 
                    
                   
                       
                   
                    
                   
                     ( 
                     15 
                     ) 
                   
                 
               
             
             
               
                 
                   
                     
                       G 
                       ⋒ 
                     
                     22 
                   
                   = 
                   
                     
                       
                         Gb 
                         12 
                       
                       + 
                       
                         3 
                         × 
                         
                           Gb 
                           32 
                         
                       
                     
                     4 
                   
                 
               
               
                 
                   Equation 
                    
                   
                       
                   
                    
                   
                     ( 
                     16 
                     ) 
                   
                 
               
             
             
               
                 
                   
                     
                       G 
                       ⋒ 
                     
                     22 
                   
                   = 
                   
                     
                       
                         Gb 
                         12 
                       
                       + 
                       
                         3 
                         × 
                         
                           Gr 
                           21 
                         
                       
                       + 
                       
                         Gr 
                         23 
                       
                       + 
                       
                         3 
                         × 
                         
                           Gb 
                           32 
                         
                       
                     
                     8 
                   
                 
               
               
                 
                   Equation 
                    
                   
                       
                   
                    
                   
                     ( 
                     17 
                     ) 
                   
                 
               
             
           
         
       
     
         [0098]    The pixel interpolation processing section  23   c  then stores the red value of the pixel R 22 , the computed blue value B 22 (hat) of the pixel R 22 , and the computed green value G 22 (hat) of the pixel R 22  in the color image data storage section  24  as pixel values after resolution degradation demosaicing. 
         [0099]    As explained above, in the modification, the demosaicing processing section  23 , in addition to the processing of the first embodiment, estimates the contrast boundary direction of the image based on the green pixels Gb 12 , Gb 32 , Gr 21 , Gr 23  in the 3×3 pixel block data BD containing the base pixel pattern BP. For the green value of the pixel R 22  of the base pixel pattern BP the demosaicing processing section  23  then determines weightings to be applied to the two green pixels present in the estimated direction. Consequently, according to the demosaicing processing section  23  of the present embodiment, not only can false yellow coloring at the contrast boundary portions of the image be efficiently suppressed from occurring, but high color reproducibility can also be preserved in the color image data. 
       Fourth Embodiment 
       [0100]    The fourth embodiment differs in the processing of the demosaicing processing section  23  from that of the image recognition system  1  of the second embodiment. In the second embodiment, the pixel interpolation processing section  23   c  of the demosaicing processing section  23  computes the green value G 22 (hat) of the pixel B 22  according to the Equation (12). Namely, in the second embodiment, the pixel interpolation processing section  23   c  takes the average value of the pixel Gr 12  and the pixel Gb 23  as the green value G 22 (hat) of the pixel B 22 . 
         [0101]    However, in the present embodiment, the contrast boundary estimation section  23   b  estimates the contrast boundary direction using the 4 individual green pixels Gr 12 , Gb 21 , Gb 23 , Gr 32  in the block data BDa, and the green value G 22 (hat) of the pixel B 22  of the base pixel pattern BP is then computed based on the pixels Gr 12 , Gb 23  according to the estimated contrast boundary direction. This computed green value G 22 (hat) is then employed as the green value of resolution degradation demosaicing. The demosaicing processing section  23  of the present embodiment will be mainly explained. Since the functional configuration of the demosaicing processing section  23  is similar to that of the first embodiment, further explanation thereof will be omitted. 
         [0102]    Explanation now follows regarding operation of the demosaicing processing section  23  according to the present embodiment. Since the processing sequence of the demosaicing processing section  23  is the same as illustrated in  FIG. 4 , explanation is based on the same figure. Processing steps that are the same as processing in the first embodiment will be omitted, and explanation only given of the steps with different processing. 
         [0103]    At step S 42 , the contrast boundary estimation section  23   b  estimates a first contrast boundary direction using the 4 individual red pixels R 11 , R 13 , R 31 , R 33  contained in the block data BDa that has been read, then estimates a second contrast boundary direction using the 4 individual green pixels Gr 12 , Gb 21 , Gb 23 , Gr 32 . 
         [0104]    Specifically, estimation of the first contrast boundary direction is performed using the estimation method of the contrast boundary direction by computation according to Equation (7) and Equation (8) of the second embodiment. 
         [0105]    Estimation of the second contrast boundary direction is performed as follows. The contrast boundary estimation section  23   b  computes a green difference value ΔG V  between the pixel Gr 12  and the pixel Gr 32  and a green difference value ΔG H  between the pixel Gb 21  and the pixel Gb 23  according to Equation (18) and Equation (19). 
         [0000]      Δ G   V   =|Gr   12   −Gr   32 |  Equation (18)
 
         [0000]      Δ G   H   =|Gb   21   −Gb   23 |  Equation (19)
 
         [0106]    The contrast boundary estimation section  23   b  then compares the difference value ΔG V  and the difference value ΔG H , and the second contrast boundary direction in the block data BDa is estimated to be in the horizontal direction when determined that the difference value ΔG V  is greater than the difference value ΔG H , the second contrast boundary direction of the block data BDa is estimated to be in the vertical direction when determined that the difference value ΔG V  is less than the difference value ΔG H , and there is estimated to be no second contrast boundary direction in the block data BDa when the difference value ΔG V  is equivalent to the difference value ΔG H . 
         [0107]    At step S 43 , the pixel interpolation processing section  23   c  computes the red value R 22 (hat) of the pixel B 22  of the base pixel pattern BP based on the pixels R 11 , R 13 , R 31 , R 33  according to the estimation result of the first contrast boundary direction by the contrast boundary estimation section  23   b , and then computes the green value G 22 (hat) of the pixel B 22  based on the pixels Gr 12 , Gb 23  according to the estimation result of the second contrast boundary direction by the contrast boundary estimation section  23   b.    
         [0108]    Specifically, computation of the red value R 22 (hat) of the pixel B 22  is the same as the computation in the second embodiment. 
         [0109]    Computation of the green value G 22 (hat) of the pixel B 22  is performed as follows. The pixel interpolation processing section  23   c  applies the green pixel Gb 23  of the base pixel pattern BP as the green value G 22 (hat) of the pixel B 22  when the second contrast boundary direction is estimated to be in the horizontal direction. The pixel interpolation processing section  23   c  applies the green pixel Gr 12  of the base pixel pattern BP as the green value G 22 (hat) of the pixel B 22  when the second contrast boundary direction is estimated to be in the vertical direction. When there is estimated to be no second contrast boundary direction then the green value G 2  (hat) of the pixel B 22  is computed according to above Equation (12). 
         [0110]    The pixel interpolation processing section  23   c  stores the blue value B 22 (hat) of the pixel B 22 , the computed red value R 22 (hat) of the pixel B 22 , and the computed green value G 22 (hat) of the pixel B 22  in the color image data storage section  24  as the pixel values after resolution degradation demosaicing. 
         [0111]    As explained above, in the present embodiment, the demosaicing processing section  23 , in addition to the processing of the second embodiment, does not take the average value of the pixel Gr 12  and pixel Gb 23  of the base pixel pattern BP as the green value of the pixel B 22  of the base pixel pattern BP, but instead estimates the contrast boundary direction of the image based on the green pixels Gr 12 , Gb 21 , Gb 23 , Gr 32  in the 3×3 pixel block data BDa containing the base pixel pattern BP, and determines the value accordingly. Consequently, according to the demosaicing processing section  23  of the present embodiment, false yellow coloring at the contrast boundary portions of the image can be even more efficiently suppressed from occurring than in the second embodiment. 
         [0112]    Consequently, in the image recognition apparatus of the present embodiment, since false yellow coloring does not readily occur in the color image data from resolution degradation demosaicing processing the Bayer pattern array RAW data with reduced frame size, false-positive detection of lane markings can be suppressed while maintaining a high detection precision of lane markings with the image recognition processing section  25 . 
       Modification of Fourth Embodiment 
       [0113]    In the above fourth embodiment the pixel interpolation processing section  23   c  of the demosaicing processing section  23  computed the green value G 22 (hat) of the pixel B 22  based on the pixels Gr 12 , Gb 23  according to the estimation result of the second contrast boundary direction by the contrast boundary estimation section  23   b.    
         [0114]    However, in this modification, the contrast boundary estimation section  23   b  estimates the contrast boundary direction using the 4 individual green pixels Gr 12 , Gb 21 , Gb 23 , Gr 32  contained in the block data BDa. The green value G 22 (hat) of the pixel B 22  of the base pixel pattern BP is then computed based on the pixels Gr 12 , Gb 21 , Gb 23 , Gr 32  according to the estimated contrast boundary direction, and this computed green value G 22 (hat) is employed as the green value of the resolution degradation demosaicing. Only the elements of the present modification that differ from the fourth embodiment will be explained. 
         [0115]    In this modification, the computation sequence of step S 43  differs from the processing sequence of the demosaicing processing section  23  in the fourth embodiment. Namely, at step S 43 , the pixel interpolation processing section  23   c  computes the red value R 22 (hat) of the pixel B 22  of the base pixel pattern BP based on the pixels R 11 , R 13 , R 31 , R 33  according to the estimation result of the first contrast boundary direction by the contrast boundary estimation section  23   b . The pixel interpolation processing section  23   c  then computes the green value G 22 (hat) of the pixel B 22  based on the pixels Gr 12 , Gb 21 , Gb 23 , Gr 32  according to the estimation result of the second contrast boundary direction by the contrast boundary estimation section  23   b.    
         [0116]    Specifically, computation of the green value G 22 (hat) of the pixel B 22  is as follows. The pixel interpolation processing section  23   c  computes the green value G 22 (hat) of the pixel B 22  according to Equation (20) when the second contrast boundary direction is estimated to be in the horizontal direction, and computes the green value G 22 (hat) of the pixel B 22  according to Equation (21) when the second contrast boundary direction is estimated to be in the vertical direction. When there is estimated to be no second contrast boundary the green value G 22 (hat) of the pixel B 22  is estimated according to Equation (22). 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       G 
                       ⋒ 
                     
                     22 
                   
                   = 
                   
                     
                       
                         Gb 
                         21 
                       
                       + 
                       
                         3 
                         × 
                         
                           Gb 
                           23 
                         
                       
                     
                     4 
                   
                 
               
               
                 
                   Equation 
                    
                   
                       
                   
                    
                   
                     ( 
                     20 
                     ) 
                   
                 
               
             
             
               
                 
                   
                     
                       G 
                       ⋒ 
                     
                     22 
                   
                   = 
                   
                     
                       
                         3 
                         × 
                         
                           Gr 
                           12 
                         
                       
                       + 
                       
                         Gr 
                         32 
                       
                     
                     4 
                   
                 
               
               
                 
                   Equation 
                    
                   
                       
                   
                    
                   
                     ( 
                     21 
                     ) 
                   
                 
               
             
             
               
                 
                   
                     
                       G 
                       ⋒ 
                     
                     22 
                   
                   = 
                   
                     
                       
                         3 
                         × 
                         
                           Gr 
                           12 
                         
                       
                       + 
                       
                         Gb 
                         21 
                       
                       + 
                       
                         3 
                         × 
                         
                           Gb 
                           23 
                         
                       
                       + 
                       
                         Gr 
                         32 
                       
                     
                     8 
                   
                 
               
               
                 
                   Equation 
                    
                   
                       
                   
                    
                   
                     ( 
                     22 
                     ) 
                   
                 
               
             
           
         
       
     
         [0117]    After resolution degradation demosaicing the pixel interpolation processing section  23   c  then stores the blue value of the pixel B 22 , the computed red value R 22 (hat) of the pixel B 22 , and the computed green value G 22 (hat) of the pixel B 22  in the color image data storage section  24  as pixel values after resolution degradation demosaicing. 
         [0118]    As explained above, in the present modification, the demosaicing processing section  23 , in addition to the processing of the second embodiment, estimates the contrast boundary direction of the image based on the green pixels Gr 12 , Gb 21 , Gb 23 , Gr 32  in the 3×3 pixel block data BDa containing the base pixel pattern BP, so as to determine weightings to be applied to the two green pixels present in the estimated direction for the green value of the pixel B 22  of the base pixel pattern BP. Consequently, according to the demosaicing processing section  23  of the present embodiment, not only can false yellow coloring at the contrast boundary portions of the image be efficiently suppressed from occurring, but high color reproducibility can also be preserved in the color image data. 
         [0119]    Note that while the image recognition system in each of the above embodiments is configured with an image processing apparatus on the image recognition apparatus side, other configurations may be made, with an image processing apparatus provided on the image capture apparatus side. 
         [0120]    In each of the above embodiments a base pixel pattern of 2×2 pixel block BP is employed, either the 2×2 pixel block BP at the bottom left hand side in the 3×3 pixel block data BD shown in  FIG. 3 , or the 2×2 pixel block BP at the top right hand side in the 3×3 pixel block data BDa shown in  FIG. 6 . However, the base pixel pattern may be provided at any of the top left hand side, the top right hand side, the bottom left hand side or the bottom right hand side in the block data BD, BDa. 
         [0121]    Section (s) of the image processing apparatus in the above embodiments, for example, the function of the demosaicing processing section, may be executed by a computer. In such cases, a demosaicing processing program for executing this processing function may be stored on a computer readable storage medium, and execution achieved by getting a computer system to read and executed the demosaicing processing program stored on the storage medium. Note that reference to “computer system” includes Operating System (OS) and hardware of any peripheral device(s). Reference to “computer readable storage medium” means a portable storage medium such as a floppy disk, magneto-optical disk, optical disk, memory card, or a storage device, such as an internal hard disk in a computer system. Reference to a “computer readable storage medium” includes configurations in which a program is dynamically retained for a short interval of time, such as with a communication line, for example a configuration in which a program is transmitted via a communication line such as a network, like the Internet, or a telecommunication line. In such cases, configuration may include temporary holding of programs, such as in volatile memory in a computer system configured with server and client. Such a program may be for executing portion(s) of the functionality described above, and the above described functionality may be executed in combination with program(s) pre-stored in a computer system. 
         [0122]    Detailed description of the embodiments has been given with reference to the drawings, however specific configurations are not limited to these embodiments, and design equivalents not departing from the spirit are included.