WO2020255715A1 - 画像処理装置、撮像装置、画像処理方法及び画像処理プログラム - Google Patents

画像処理装置、撮像装置、画像処理方法及び画像処理プログラム Download PDF

Info

Publication number
WO2020255715A1
WO2020255715A1 PCT/JP2020/021934 JP2020021934W WO2020255715A1 WO 2020255715 A1 WO2020255715 A1 WO 2020255715A1 JP 2020021934 W JP2020021934 W JP 2020021934W WO 2020255715 A1 WO2020255715 A1 WO 2020255715A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
correction
frame
color
unit
Prior art date
Application number
PCT/JP2020/021934
Other languages
English (en)
French (fr)
Inventor
和田 哲
田中 康一
哲也 藤川
幸徳 西山
林 健吉
Original Assignee
富士フイルム株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 富士フイルム株式会社 filed Critical 富士フイルム株式会社
Priority to JP2021527556A priority Critical patent/JP7234361B2/ja
Publication of WO2020255715A1 publication Critical patent/WO2020255715A1/ja
Priority to JP2023026203A priority patent/JP7422911B2/ja
Priority to JP2024004743A priority patent/JP2024036370A/ja

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/10Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from different wavelengths
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/76Circuitry for compensating brightness variation in the scene by influencing the image signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals

Definitions

  • the present invention relates to an image processing device, an imaging device, an image processing method, and an image processing program, and particularly relates to a technique for performing different color correction between frames of a moving image according to a change in a light source.
  • the image processing apparatus described in Patent Document 1 calculates an integral value of the signal amount in units of lines of the image to be corrected for removing flicker, and applies this integral value to detect the flicker component contained in each line of the image frame. To do.
  • This detected flicker component is data corresponding to the flicker waveform of the actual lighting.
  • Flicker removal is performed by executing a correction process to which a flicker correction coefficient composed of a reverse phase pattern of the flicker component is applied.
  • the image correction device described in Patent Document 2 uses a CMOS image sensor, and in an image pickup device that performs imaging with a rolling shutter, a flicker correction circuit that corrects flicker of the original image represented by the output of the CMOS image sensor is provided. Be prepared.
  • the area correction coefficient calculation circuit of the flicker correction circuit divides the original image into M in the vertical direction and N in the horizontal direction, calculates the area average value by averaging the pixel signals for each divided area, and calculates the area average value for each divided area. By calculating the average of the area average values for multiple frames, the area reference value that does not include the flicker component is calculated.
  • the flicker correction circuit corrects the original image by using the area correction coefficient calculated from the ratio of the area reference value and the area average value of the original image.
  • One embodiment according to the technique of the present disclosure provides an image processing device, an imaging device, an image processing method, and an image processing program that perform different color corrections between frames of a moving image as the light source changes.
  • the image processing apparatus includes one or more processors, and the one or more processors include a moving image acquisition process for acquiring moving image data captured by an imaging element and a moving image acquisition process.
  • the frame identification process for specifying the reference frame and the correction frame for the reference frame from a plurality of frames constituting the acquired moving image data, and the image area used for calculating the first correction coefficient in the frame are determined, and the first from the reference frame.
  • the first image area determination process for determining the reference image area and determining the first correction image area corresponding to the first reference image area from the correction frame, and the first reference color signal from the color image data of the first reference image area.
  • the first color signal acquisition process of acquiring and acquiring the first correction color signal from the color image data of the first correction image area, and the first correction coefficient for matching the first correction color signal with the first reference color signal are calculated. It is configured to execute one correction coefficient calculation process.
  • one or more processors apply the first correction coefficient calculated by the first correction coefficient calculation process to the correction frame to perform color correction of the correction frame. It is preferable that the color correction process is further executed.
  • the first reference image area and the first corrected image area determined by the first image area determination process are each a plurality of image areas, and each image area is specified. It is preferably an image area of peripheral pixels including pixels or specific pixels.
  • the first reference color signal and the first correction color signal are each composed of a plurality of color signals.
  • the plurality of color signals of the first reference color signal are red R ref , green G ref , and blue B ref, and a plurality of colors of the first correction color signal.
  • the first correction coefficient calculation process is performed by the following equation in a plurality of image regions.
  • R ref ⁇ 1, R + ⁇ 1, G + ⁇ 1, B + ⁇ 1
  • the difference between R ref and R, G ref and G, and B ref and B is minimized in a plurality of image regions, respectively. It is preferable to calculate ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, and ⁇ 3.
  • the moving image data is imaged by sequentially exposing the pixels formed on the image sensor to at least one or more pixels or every scanning line.
  • the first image region determination process determines the first reference image region and the first correction image region from the image regions in which the timing of the exposure start and the exposure end of the image sensor are the same, respectively. It is preferable to do so.
  • the first reference image area in the reference frame and the first corrected image area in the correction frame may be set to the same position in the frame. preferable.
  • one or more processors are configured to execute a flicker phase detection process for detecting the flicker phase of the light source from moving image data, and the frame identification process is performed. It is preferable to specify the reference frame by using the phase of the flicker.
  • the frame specifying process it is preferable to specify the color-corrected correction frame by the first color correction process as a reference frame for the next correction frame.
  • the moving image acquisition processing acquires moving image data composed of a plurality of frames whose exposure time per frame is shorter than the frame interval.
  • the moving image data is sequentially exposed to pixels formed on the image pickup element under a light source having flicker at least one or more pixels or every scanning line.
  • the moving image is captured by performing an operation, and the moving image acquisition process is moving image data composed of a plurality of frames whose exposure time per frame is shorter than the frame interval and shorter than the flicker cycle of the light source.
  • One or more processors identify the line image on the reference scanning line as the reference line image and correct the line image on the scanning line adjacent to the reference scanning line in each frame constituting the moving image data.
  • the line image identification process for specifying as a line image and the image area used for calculating the second correction coefficient in the line image are determined, the second reference image area is determined from the reference line image, and the second reference image is determined from the correction line image.
  • the second image area determination process for determining the second corrected image area corresponding to the area, the second reference color signal obtained from the color image data of the second reference image area, and the second from the color image data of the second corrected image area.
  • It is configured to execute a second color correction process that applies the calculated second correction coefficient to the correction line image to perform color correction of the correction line image, and the line image identification process is performed by the second color correction process. It is preferable to specify the color-corrected correction line image as a reference line image for the next correction line image.
  • the moving image data is sequentially exposed to pixels formed on the image pickup element under a light source having flicker at least one or more pixels or every scanning line.
  • the moving image is captured by performing an operation, and the moving image acquisition process is moving image data composed of a plurality of frames whose exposure time per frame is shorter than the frame interval and shorter than the flicker cycle of the light source.
  • one or more processors specify the line image on the reference scanning line as the reference line image in each frame constituting the moving image data, and correct the line image on the scanning line other than the reference scanning line.
  • the line image identification process for specifying as an image and the image area used for calculating the second correction coefficient in the line image are determined, the second reference image area is determined from the reference line image, and the second reference image is determined for each correction line image.
  • the second image area determination process for determining the second corrected image area corresponding to the area, the second reference color signal obtained from the color image data of the second reference image area, and the second from the color image data of the second corrected image area.
  • the second color signal acquisition process for acquiring the two correction color signals
  • the second correction coefficient calculation process for calculating the second correction coefficient for matching the second correction color signal with the second reference color signal, and the calculated second correction coefficient.
  • Is configured to execute a second color correction process for performing color correction of the correction line image by applying the above to the correction line image
  • the second image area determination process is the first of the reference line images in the correction line image. 2 It is preferable to determine an image region in which the colors of the reference image region are similar to each other as the second corrected image region.
  • one or more processors are configured to execute an object detection process for detecting an object from a frame, and a second image area determination process is performed by the object detection process. It is preferable to determine the image area of the correction line image including the same object as the detected object included in the second reference image area of the reference line image as the second correction image area.
  • the image pickup device includes an image pickup element for capturing a moving image and an image processing device according to any one of the above, and the moving image acquisition process is performed on a moving image captured by the image pickup device. Acquires moving image data indicating.
  • the image processing method includes a step of acquiring moving image data captured by an imaging element and a step of specifying a reference frame and a correction frame for the reference frame from a plurality of frames constituting the moving image data.
  • the image area used for calculating the first correction coefficient in the frame is determined, a plurality of first reference image areas are determined from the reference frame, and a plurality of first reference image areas corresponding to the plurality of first reference image areas are determined from the correction frame.
  • a step of determining the corrected image area a plurality of first reference color signals are acquired from the color image data of each of the plurality of first reference image areas, and a plurality of firsts are obtained from the color image data of each of the plurality of first corrected image areas.
  • a step of acquiring a correction color signal, a step of calculating a first correction coefficient for matching a plurality of first correction color signals with a plurality of first reference color signals, and a step of applying the calculated first correction coefficient to a correction frame. Includes a step of performing color correction of the correction frame.
  • the first reference color signal is red R ref , green G ref , and blue B ref
  • the first correction color signal is red R, green G.
  • the step of calculating the first correction coefficient is as follows in a plurality of image regions.
  • R ref ⁇ 1, R + ⁇ 1, G + ⁇ 1, B + ⁇ 1
  • the step of calculating the first correction coefficient has a minimum difference between R ref and R, G ref and G, and B ref and B in a plurality of image regions, respectively. It is preferable to calculate ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, and ⁇ 3.
  • the image processing program has a function of acquiring moving image data captured by an imaging element and a function of specifying a reference frame and a correction frame for a reference frame from a plurality of frames constituting the moving image data.
  • the image area used for calculating the first correction coefficient in the frame is determined, a plurality of first reference image areas are determined from the reference frame, and a plurality of first reference image areas corresponding to the plurality of first reference image areas are determined from the correction frame.
  • a function for determining a corrected image region, a plurality of first reference color signals are acquired from color image data for each of a plurality of first reference image regions, and a plurality of firsts are obtained from color image data for each of a plurality of first corrected image regions.
  • the function of performing color correction of the correction frame is realized by a computer.
  • FIG. 1 is a perspective view of an imaging device including a shake correction device according to the present invention as viewed diagonally from the front.
  • FIG. 2 is a rear view of the image pickup apparatus shown in FIG.
  • FIG. 3 is a block diagram showing an embodiment of the internal configuration of the image pickup apparatus shown in FIG.
  • FIG. 4 is a block diagram showing a first embodiment of the image processing apparatus according to the present invention.
  • FIG. 5 is a diagram showing an embodiment of a stacked CMOS showing an example of a hardware configuration of an image processing apparatus.
  • FIG. 6 is a block diagram showing a second embodiment of the image processing apparatus according to the present invention.
  • FIG. 7 is a diagram showing an example of a reference frame F ref of a moving image captured outdoors and a correction frame F of a moving image captured indoors.
  • FIG. 8 is a diagram showing an example of a reference frame F ref and a correction frame F prepared in advance.
  • FIG. 9 is a diagram schematically showing the relationship between the flicker of the light source, the exposure operation of the image sensor, and the moving image data.
  • FIG. 10 is a block diagram showing a third embodiment of the image processing apparatus according to the present invention.
  • FIG. 11 is a block diagram showing a fourth embodiment of the image processing apparatus according to the present invention.
  • FIG. 12 is a flowchart showing an embodiment of the image processing method according to the present invention.
  • FIG. 13 is an external view of a smartphone according to an embodiment of the imaging device according to the present invention.
  • FIG. 14 is a block diagram showing a configuration of a smartphone.
  • FIG. 1 is a perspective view of an image pickup apparatus including the image processing apparatus according to the present invention as viewed obliquely from the front
  • FIG. 2 is a rear view of the image pickup apparatus shown in FIG.
  • the image pickup apparatus 10 is a mirrorless digital single-lens camera composed of an interchangeable lens 100 and a camera body 200 to which the interchangeable lens 100 can be attached and detached.
  • a main body mount 260 on which an interchangeable lens 100 is mounted, a finder window 20 of an optical finder, and the like are provided on the front surface of the camera main body 200, and a shutter release switch 22 and a shutter are mainly provided on the upper surface of the camera main body 200.
  • a speed dial 23, an exposure compensation dial 24, a power lever 25, and a built-in flash 30 are provided.
  • the back surface of the camera body 200 is mainly provided with a liquid crystal monitor 216, an eyepiece 26 of an optical viewfinder, a MENU / OK key 27, a cross key 28, a play button 29, and the like.
  • the liquid crystal monitor 216 displays a live view image in the imaging mode, reproduces and displays the captured image in the playback mode, functions as a display unit for displaying various menu screens, and notifies the user of various information. Functions as a notification unit.
  • the MENU / OK key 27 has both a function as a menu button for issuing a command to display a menu on the screen of the liquid crystal monitor 216 and a function as an OK button for instructing confirmation and execution of selected contents. The key.
  • the cross key 28 is an operation unit for inputting instructions in four directions of up, down, left, and right, and functions as a multifunction key for selecting an item from the menu screen and instructing selection of various setting items from each menu.
  • the up key and down key of the cross key 28 function as a zoom switch at the time of imaging or a playback zoom switch at the playback mode
  • the left key and the right key are frame advance (forward and reverse direction) buttons in the playback mode. Functions as. It also functions as an operation unit for designating a desired subject for focus adjustment or color correction from a plurality of subjects displayed on the liquid crystal monitor 216.
  • first moving image imaging mode which is a type of moving image imaging mode and includes a moving image imaging mode (second moving image imaging mode) for capturing a moving image for still image extraction.
  • the imaging mode can be set.
  • the second moving image imaging mode is a mode for setting imaging conditions suitable for extracting a still image and extracting a high-quality still image from the moving image. For example, it is 1 than the frame interval of the moving image.
  • the exposure time per frame is set short.
  • the playback button 29 is a button for switching to a playback mode in which the captured still image or moving image is displayed on the liquid crystal monitor 216.
  • FIG. 3 is a block diagram showing an embodiment of the internal configuration of the image pickup apparatus 10.
  • the interchangeable lens 100 that functions as an imaging optical system constituting the imaging device 10 is manufactured in accordance with the communication standard of the camera body 200, and can communicate with the camera body 200 as described later. It is an interchangeable lens.
  • the interchangeable lens 100 includes an imaging optical system 102, a focus lens control unit 116, an aperture control unit 118, a lens side CPU (Central Processing Unit) 120, a flash ROM (Read Only Memory) 126, a lens side communication unit 150, and a lens mount. It is equipped with 160.
  • the imaging optical system 102 of the interchangeable lens 100 includes a lens group 104 including a focus lens and an aperture 108.
  • the focus lens control unit 116 moves the focus lens according to a command from the lens side CPU 120, and controls the position (focus position) of the focus lens.
  • the aperture control unit 118 controls the aperture 108 according to a command from the lens-side CPU 120.
  • the lens-side CPU 120 controls the interchangeable lens 100 in an integrated manner, and incorporates a ROM 124 and a RAM (Random Access Memory) 122.
  • the flash ROM 126 is a non-volatile memory for storing programs and the like downloaded from the camera body 200.
  • the lens-side CPU 120 collectively controls each part of the interchangeable lens 100 with the RAM 122 as a work area according to a control program stored in the ROM 124 or the flash ROM 126.
  • the lens-side communication unit 150 communicates with the camera body 200 via a plurality of signal terminals provided on the lens mount 160 in a state where the lens mount 160 is mounted on the body mount 260 of the camera body 200. That is, the lens-side communication unit 150 receives a request signal and a response signal from the main body-side communication unit 250 of the camera body 200 connected via the lens mount 160 and the main body mount 260 in accordance with the command of the lens-side CPU 120. Transmission / reception (two-way communication) is performed, and lens information (position information of the focus lens, aperture information, etc.) of each optical member of the imaging optical system 102 is notified to the camera body 200.
  • the interchangeable lens 100 includes a detection unit (not shown) that detects the position information of the focus lens and the aperture information.
  • the diaphragm information is information indicating the diaphragm value (F value) of the diaphragm 108, the aperture diameter of the diaphragm 108, and the like.
  • the lens-side CPU 120 In order to respond to the request for lens information from the camera body 200, the lens-side CPU 120 preferably holds various lens information including the detected focus lens position information and aperture information in the RAM 122. Further, the lens information is detected when there is a request for lens information from the camera body 200, or is detected when the optical member is driven, or has a fixed period (a period sufficiently shorter than the frame period of the moving image). It is detected by and the detection result can be retained.
  • the camera body 200 constituting the image sensor 10 shown in FIG. 3 includes an image sensor 201, an image sensor control unit 202, an analog signal processing unit 203, an A / D (Analog to Digital) converter 204, an image input controller 205, and a digital signal.
  • Processing unit 206 RAM 207, compression / decompression processing unit 208, media control unit 210, memory card 212, display control unit 214, liquid crystal monitor 216, main unit CPU 220, operation unit 222, flash ROM 226, ROM 228, AF (Autofocus) control unit 230 , AE (Auto Exposure) control unit 232, white balance correction unit 234, wireless communication unit 236, GPS (Global Positioning System) receiver unit 238, power supply control unit 240, battery 242, main unit side communication unit 250, main unit mount 260, built-in It includes a flash light emitting unit 270, a flash control unit 272, a focal plane shutter (FPS: focal-plane shutter) 280, and an FPS control unit 296 that constitute the flash 30 (FIG. 1).
  • FPS focal plane shutter
  • the image sensor 201 that functions as an image pickup unit is composed of a CMOS (Complementary Metal-Oxide Semiconductor) type color image sensor.
  • CMOS Complementary Metal-Oxide Semiconductor
  • the image sensor 201 is not limited to the CMOS type, and may be a CCD (Charge Coupled Device) type image sensor.
  • the image sensor 201 has red (R) and green colors (R) on a plurality of pixels composed of photoelectric conversion elements (photonodes) two-dimensionally arranged in the x direction (horizontal direction) and the y direction (vertical direction).
  • a color filter of any one of the three primary color filters (R filter, G filter, and B filter) of G) and blue (B) is arranged according to a predetermined color filter arrangement, and the pixels of each color of RGB are arranged. Is configured.
  • the color filter sequence can be a general Bayer sequence, but is not limited to this, and may be another color filter sequence such as a Trans (registered trademark) sequence.
  • the optical image of the subject imaged on the light receiving surface of the image sensor 201 by the image pickup optical system 102 of the interchangeable lens 100 is converted into an electric signal by the image pickup element 201.
  • Charges corresponding to the amount of incident light are accumulated in each pixel formed on the image sensor 201, and an electric signal corresponding to the amount of charge (signal charge) accumulated in each pixel is used as an image signal from the image sensor 201. Read out.
  • the image sensor control unit 202 controls to read out an image signal from the image sensor 201 in accordance with a command from the CPU 220 on the main body side.
  • the image sensor control unit 202 drives the image sensor 201 by the so-called global shutter method or lock ring shutter method by the shutter control signal from the main body side CPU 220.
  • the global shutter method means that in the CMOS image sensor 201, all the pixels in one screen are reset all at once and the exposure operation is started (that is, the accumulation of charge is started for all the pixels in one screen).
  • the rolling shutter method is a method in which at least one or more scanning lines or pixels are sequentially exposed (that is, each scanning line or pixel is sequentially reset) in the CMOS image sensor 201. It is a method of starting the accumulation of charges and reading out the accumulated charges, and is also called a focal plane shutter method.
  • the analog signal processing unit 203 performs various analog signal processing on the analog image signal obtained by imaging the subject with the image sensor 201.
  • the analog signal processing unit 203 includes a sampling hold circuit, a color separation circuit, an AGC (Automatic Gain Control) circuit, and the like.
  • the AGC circuit functions as a sensitivity adjustment unit that adjusts the sensitivity at the time of imaging (ISO (International Organization for Standardization)), adjusts the gain of the amplifier that amplifies the input image signal, and changes the signal level of the image signal. Make sure it is within the appropriate range.
  • the A / D converter 204 converts the analog image signal output from the analog signal processing unit 203 into a digital image signal.
  • the image sensor 201 is a CMOS image sensor
  • the analog signal processing unit 203 and the A / D converter 204 are often built in the image sensor 201.
  • the digital signal processing unit 206 performs various digital signal processing on the RAW data stored in the RAM 207.
  • the digital signal processing unit 206 appropriately reads the RAW data stored in the RAM 207, offsets the read RAW data, and color-corrects the RGB RAW data into a new RGB signal having accurate color reproducibility.
  • Image data after digital signal processing such as matrix processing, gain control processing including sensitivity correction, gamma correction processing, demosaicing processing (also called demosaiking processing, simultaneous processing), RGB / YCrCb conversion processing, etc. Is stored in the RAM 207 again.
  • the demosaic process is, for example, in the case of an imaging device having a color filter of three primary colors of RGB, a process of calculating color information of all RGB for each pixel from a mosaic image composed of RGB, and mosaic data (point sequential). Generates RGB three-sided image data simultaneously from (RGB data). Further, the RGB / YCrCb conversion process is a process of converting the simultaneous RGB data into luminance data (Y) and color difference data (Cr, Cb).
  • the compression / decompression processing unit 208 performs compression processing on the uncompressed luminance data Y and the color difference data Cb and Cr once stored in the RAM 207 when recording a still image or a moving image.
  • a still image for example, it is compressed in the JPEG (Joint Photographic coding Experts Group) format, and in the case of a moving image, for example, H.I. Compress in 264 format.
  • the image data compressed by the compression / decompression processing unit 208 is recorded in the memory card 212 via the media control unit 210. Further, the compression / decompression processing unit 208 performs decompression processing on the compressed image data obtained from the memory card 212 via the media control unit 210 in the playback mode to generate uncompressed image data.
  • the media control unit 210 controls to record the image data compressed by the compression / decompression processing unit 208 on the memory card 212. Further, the media control unit 210 controls to read the compressed image data from the memory card 212.
  • the display control unit 214 controls to display the uncompressed image data stored in the RAM 207 on the liquid crystal monitor 216.
  • the liquid crystal monitor 216 is composed of a liquid crystal display device, it may be composed of a display device such as an organic electroluminescence instead of the liquid crystal monitor 216.
  • the digital image signal continuously generated by the digital signal processing unit 206 is temporarily stored in the RAM 207.
  • the display control unit 214 converts the digital image signal temporarily stored in the RAM 207 into a signal format for display, and sequentially outputs the digital image signal to the liquid crystal monitor 216.
  • the captured image is displayed on the liquid crystal monitor 216 in real time, and the liquid crystal monitor 216 can be used as an electronic viewfinder.
  • the shutter release switch 22 is an imaging instruction unit for inputting an imaging instruction for a still image or a moving image, and is composed of a so-called "half-press” and "full-press" two-stage stroke type switch.
  • the shutter release switch 22 is half-pressed to output an S1 on signal, and half-pressed to a full-pressed output to output an S2 on signal and an S1 on signal. Then, the CPU 220 on the main body side executes shooting preparation processing such as AF control (automatic focus adjustment) and AE control (automatic exposure control), and when an S2 on signal is output, executes still image imaging processing and recording processing. To do.
  • shooting preparation processing such as AF control (automatic focus adjustment) and AE control (automatic exposure control
  • the AF control and the AE control are automatically performed when the auto mode is set by the operation unit 222, respectively, and the AF control and the AE control are not performed when the manual mode is set. Needless to say.
  • the camera body 200 in the moving image imaging mode, when the shutter release switch 22 is fully pressed to output the S2 ON signal, the camera body 200 enters the moving image recording mode in which the moving image recording is started, and the moving image is moved.
  • the image processing and recording processing of the image are executed and then the S2 ON signal is output by fully pressing the shutter release switch 22 again, the camera body 200 goes into the standby state and the moving image recording processing is performed. To pause.
  • the shutter release switch 22 is not limited to the form of a two-stage stroke type switch consisting of a half-press and a full-press, and may output an S1 on signal and an S2 on signal with a single operation, and each of them may be output individually.
  • a switch may be provided to output an S1 on signal and an S2 on signal.
  • the operation instructions may be output by touching the area corresponding to the operation instructions displayed on the screen of the touch panel as these operation means, and the shooting preparation process or imaging may be performed.
  • the form of the operating means is not limited to these as long as it instructs the processing.
  • the still image or moving image acquired by imaging is compressed by the compression / decompression processing unit 208, and the compressed image data is the required imaging date / time, GPS information, imaging conditions (F value, shutter speed, ISO sensitivity, etc.).
  • the attached information is converted into an image file added to the header, and then recorded on the memory card 212 via the media control unit 210.
  • the CPU 220 on the main body side comprehensively controls the operation of the entire camera main body 200 and the drive of the optical member of the interchangeable lens 100, and is based on the input from the operation unit 222 and the like including the shutter release switch 22, each part of the camera main body 200 and Controls the interchangeable lens 100.
  • the flash ROM 226 is a non-volatile memory that can be read and written, and stores setting information.
  • the ROM 228 stores a camera control program executed by the CPU 220 on the main body side, an image processing program according to the present invention, defect information of the image sensor 201, various parameters and tables used for image processing, and the like.
  • the main body side CPU 220 controls each part of the camera main body 200 and the interchangeable lens 100 while using the RAM 207 as a work area according to the camera control program stored in the ROM 228.
  • the AF detection unit 230 calculates the numerical value required for AF control based on the digital image signal.
  • contrast AF for example, the integrated value (focus evaluation value) of the high frequency component of the G signal in a predetermined AF area is calculated.
  • the CPU 220 on the main body side moves the focus lens included in the lens group 104 of the interchangeable lens 100 to a position where the focus evaluation value is maximized (that is, a position where the contrast is maximized) during AF control.
  • the AF is not limited to the contrast AF.
  • the AF detects the defocus amount based on the pixel data of the phase difference detection pixel provided in the image sensor, and focuses so that the defocus amount becomes zero.
  • the phase difference AF that moves the lens may be performed.
  • the AE control unit 232 is a portion that detects the brightness of the subject (subject brightness), and is a numerical value (exposure value (EV value)) required for AE control and AWB (Auto White Balance) control corresponding to the subject brightness. )) Is calculated.
  • the AE control unit 232 calculates the EV value from the brightness of the image acquired via the image sensor 201, the shutter speed at the time of acquiring the brightness of the image, and the F value.
  • the CPU 220 on the main body side can perform AE control by determining the F value, shutter speed and ISO sensitivity from a predetermined program diagram based on the EV value obtained from the AE control unit 232.
  • the white balance correction unit 234 calculates the white balance gain (WB (White Balance) gain) Gr, Gg, Gb for each color data of RGB data (R data, G data and B data), and calculates the R data, G data and White balance correction is performed by multiplying the B data by the calculated WB gains Gr, Gg, and Gb, respectively.
  • WB White Balance
  • the subject is illuminated based on the scene recognition (judgment of outdoor, indoor, etc.) based on the brightness (EV value) of the subject, and the color temperature of the ambient light.
  • a method is conceivable in which the WB gain corresponding to the specified light source type is read out from the storage unit in which the appropriate WB gain is stored in advance for each light source type, but at least the EV value is used to read the WB gain.
  • Other known methods for determining Gr, Gg, Gb can be considered.
  • the wireless communication unit 236 is a part that performs short-range wireless communication of standards such as Wi-Fi (Wi-Filess Fidelity) (registered trademark) and Bluetooth (registered trademark), and is connected to peripheral digital devices (mobile terminals such as smartphones). Send and receive necessary information between.
  • standards such as Wi-Fi (Wi-Filess Fidelity) (registered trademark) and Bluetooth (registered trademark)
  • peripheral digital devices mobile terminals such as smartphones.
  • the GPS receiving unit 238 receives GPS signals transmitted from a plurality of GPS satellites according to instructions from the CPU 220 on the main body side, executes positioning calculation processing based on the received plurality of GPS signals, and executes positioning calculation processing based on the received GPS signals, and the latitude and longitude of the camera main body 200. , And GPS information consisting of altitude is acquired.
  • the acquired GPS information can be recorded in the header of the image file as ancillary information indicating the imaging position of the captured image.
  • the power supply control unit 240 supplies the power supply voltage supplied from the battery 242 to each part of the camera body 200 according to the command of the CPU 220 on the main body side. Further, the power supply control unit 240 applies the power supply voltage supplied from the battery 242 to each part of the interchangeable lens 100 via the main body mount 248 and the lens mount 160 in accordance with the command of the main body side CPU 220.
  • the lens power switch 244 switches the power supply voltage applied to the interchangeable lens 100 on and off and switches the level via the main body mount 248 and the lens mount 160 according to the command of the main body side CPU 220.
  • the main body side communication unit 246 transmits and receives a request signal and a reply signal between the main body side communication unit 246 and the lens side communication unit 150 of the interchangeable lens 100 connected via the main body mount 248 and the lens mount 160 according to the command of the main body side CPU 220.
  • Two-way communication As shown in FIG. 1, the main body mount 260 is provided with a plurality of terminals 260A, and when the interchangeable lens 100 is attached to the camera main body 200 (the lens mount 160 and the main body mount 260 are connected), the main body is mounted.
  • a plurality of terminals 260A (FIG. 1) provided on the mount 260 and a plurality of terminals (not shown) provided on the lens mount 160 are electrically connected, and the main body side communication unit 250 and the lens side communication unit 150 are electrically connected. Two-way communication with and from is possible.
  • the built-in flash 30 (FIG. 1) is, for example, a TTL (Through The Lens) automatic dimming flash, and is composed of a flash light emitting unit 270 and a flash control unit 272.
  • the flash control unit 272 has a function of adjusting the amount of flash light (guide number) emitted from the flash light emitting unit 270. That is, the flash control unit 272 causes the flash light emitting unit 270 to emit light in synchronization with the flash imaging instruction from the main body side CPU 220, and the reflected light (including ambient light) incident through the imaging optical system 102 of the interchangeable lens 100. When the photometry is started and the photometric value reaches the standard exposure value, the flash light emission from the flash light emitting unit 270 is stopped.
  • the focal plane shutter 280 constitutes the mechanical shutter of the image pickup device 10 and is arranged immediately before the image pickup element 201.
  • the FPS control unit 296 is a part that outputs a control signal to the FPS drive unit (charge motor, front curtain electromagnet and rear curtain electromagnet (not shown)) based on an instruction input from the main body side CPU 220.
  • the FPS control unit In 296 the front curtain electromagnet holding the front curtain at the charge position is turned off, the front curtain is driven in the opening direction by the front curtain traveling spring, and the exposure opening is opened.
  • the FPS control unit 296 turns off the rear curtain electromagnet holding the rear curtain at the charge position after the lapse of time corresponding to the shutter speed, and causes the rear curtain to travel in the closing direction by the rear curtain traveling spring. Close the exposure opening. As a result, the image sensor 201 is exposed for a time corresponding to the shutter speed.
  • the camera body 200 is provided with an image processing device according to the present invention.
  • the image processing apparatus is provided in the digital signal processing unit 206, the digital signal processing unit 206, and the CPU 220 on the main body side, or is provided as dedicated hardware (not shown).
  • FIG. 4 is a block diagram showing a first embodiment of the image processing apparatus according to the present invention.
  • the image processing apparatus shown in FIG. 4 captures a moving image in a moving image imaging mode (particularly, a second moving image imaging mode for extracting a still image), different colors are used between frames of the moving image as the light source changes.
  • It is a device that performs correction, and is mainly a moving image acquisition unit 302, a frame identification unit 310, a first image area determination unit 320, a first color signal acquisition unit 330, a first correction coefficient calculation unit 340, and a first color correction unit 350. It is composed of.
  • the image sensor 201 is sequentially reset for each scanning line, the exposure operation (start of charge accumulation) is sequentially performed for each scanning line, and the image is sequentially accumulated for each scanning line after the exposure time has elapsed. It is assumed that a moving image is captured by the lock ring shutter method that reads out the data corresponding to the charged charge.
  • the moving image acquisition unit 302 is a part in which the second moving image imaging mode is set and acquires the moving image data captured by the interchangeable lens 100, the image sensor 201, and the like.
  • the moving image data is temporarily stored in the RAM 207.
  • the obtained RAW data 300 is acquired.
  • the RAW data 300 acquired by the moving image acquisition unit 302 is output to the first color correction unit 350 and the frame identification unit 310.
  • the frame specifying unit 310 identifies a reference frame and a correction frame for the reference frame from a plurality of frames constituting the moving image acquired by the moving image acquisition unit 302.
  • the frame identification unit 310 of this example has a flicker phase detection unit 312, and the flicker phase detection unit 312 detects the flicker phase of the light source.
  • artificial light sources such as fluorescent lamps and LEDs (light emitting diodes) are affected by the frequency of the commercial power supply (50 Hz or 60 Hz) and correspond to the frequency of the commercial power supply. Flicker occurs.
  • the flicker of the artificial light source changes the color between the frames of the moving image, and the exposure time per frame is shorter than the frame interval (shorter than the flicker cycle). ) In the second moving image imaging mode, the change in color between frames is remarkable.
  • the flicker phase detection unit 312 detects the flicker frequency and flicker phase of the light source by changing the brightness of each scanning line of the RAW data 300 for one frame acquired by the moving image acquisition unit 302.
  • the flicker phase can be detected as, for example, the time when the brightness of the light source becomes maximum from the exposure start time with reference to the exposure start time of the first line of each frame.
  • the frame specifying unit 310 determines a frame having a specific flicker phase that appears at regular intervals as a reference frame and another frame as a correction frame.
  • the reference frame for each fixed cycle is preferably the brightest frame within the fixed cycle.
  • the first image area determination unit 320 is a portion that determines an image area used for calculating the first correction coefficient in the frame from the reference frame and the correction frame specified by the frame identification unit 310, respectively, and the reference frame and the correction.
  • the first reference image area is determined from the reference frame in each calculation area of the frame, and the first correction image area corresponding to the first reference image area is determined from the correction frame.
  • Each calculation area of the reference frame and the correction frame may be the entire area of the frame, the focus area of the frame, or the center area of the frame.
  • the first reference image area can be, for example, an image area of a specific pixel or a peripheral pixel including the specific pixel at a plurality of preset pixel positions in the calculation area of the reference frame.
  • the region of one pixel at a specific position can also be a region constituting the first reference image region.
  • the first corrected image area is an area within the calculation area of the correction frame, and is an area corresponding to the first reference image area.
  • the first reference image region and the first corrected image region of this example are image regions on the scanning line where the timings of the exposure start and the exposure end of the image sensor 201 are the same, and are regions at the same positions.
  • the first color signal acquisition unit 330 is based on the color image data (in this example, RGB RAW data) of the first reference image area determined by the first image area determination unit 320, that is, the first reference image area of the RAW data.
  • the representative value of the pixel data of the R pixel, the representative value of the pixel data of the G pixel, and the representative value of the pixel data of the B pixel are set to the first reference color signal (R ref , G ref , for each of the plurality of first reference image areas. Obtained as B ref ).
  • the pixel data of that pixel is a representative value.
  • the average value of the pixel data of the plurality of R pixels or the pixel data of the plurality of R pixels is set to the distance from the center of the first reference image area.
  • a value obtained by weighting and averaging can be used as a representative value.
  • the representative values of the G pixels and the B pixels can be obtained in the same manner as described above.
  • the first color signal acquisition unit 330 is based on the RGB RAW data of the first correction image area determined by the first image area determination unit 320 in the same manner, and is obtained from the pixel data of the R pixels of the first correction image area of the RAW data.
  • the representative value, the representative value of the pixel data of the G pixel, and the representative value of the pixel data of the B pixel are acquired as the first corrected color signal (R, G, B) for each of the plurality of first corrected image regions.
  • the first correction coefficient calculation unit 340 calculates the first correction coefficient that matches the first correction color signal (R, G, B) with the first reference color signal (R ref , G ref , B ref ).
  • the first correction coefficient calculation unit 340 uses the following equation [Equation 1] in a plurality of image regions (a plurality of pairs of image regions of the first reference image region and the first correction image region).
  • R ref ⁇ 1, R + ⁇ 1, G + ⁇ 1, B + ⁇ 1 [Number 2]
  • G ref ⁇ 2 ⁇ R + ⁇ 2 ⁇ G + ⁇ 2 ⁇ B + ⁇ 2 [Number 3]
  • B ref ⁇ 3 ⁇ R + ⁇ 3 ⁇ G + ⁇ 3 ⁇ B + ⁇ 3
  • the first correction coefficients that establish the above are calculated: ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, and ⁇ 3.
  • the first correction coefficient calculation unit 340 uses the first correction coefficient ( ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, which establishes the equation [Equation 1] to the equation [Equation 3].
  • ⁇ 3 ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, which minimize the difference between R ref and R, G ref and G, and B ref and B, respectively, in a plurality of image regions by the least self-squared method. Calculate ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, and ⁇ 3.
  • the first correction coefficient ( ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3) shown in the formulas [Equation 1] to [Equation 3] is a multiplier of the RGB RAW data of the correction frame.
  • the first correction coefficient ( ⁇ 1, ⁇ 2, ⁇ 3) is an offset value of the RGB RAW data of the correction frame.
  • the offset value is the exposure time of the correction frame when the light source in the exposure time of the correction frame has a bias in the spectrum such as monochromatic light, or the light source in the exposure time of the reference frame includes all wavelength bands of RGB.
  • This is a correction coefficient required to improve the color reproducibility of the correction frame in the color correction described later when the light source in the above is insufficient in any one or more wavelength bands of the RGB wavelength bands. Therefore, depending on the wavelength band of the light source, the first correction coefficient ( ⁇ 1, ⁇ 2, ⁇ 3) may be set to zero, or the first correction coefficient ( ⁇ 1, ⁇ 2, ⁇ 3) for offset may not be provided.
  • the first color correction unit 350 corrects the first correction coefficient ( ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3) calculated by the first correction coefficient calculation unit 340. Apply to the frame and perform color correction of the correction frame.
  • the first color correction unit 350 [Equation 1 ]
  • the first correction is made to the pixel data (R) of the R pixel, the pixel data (G) of the G pixel around the R pixel, and the pixel data (B) of the B pixel around the R pixel, respectively, as shown in the equation.
  • the pixel data of the color-corrected R pixel is acquired by multiplying the coefficients ( ⁇ 1, ⁇ 1, ⁇ 1) and adding the offset value ⁇ 1.
  • the pixel data (R) of the R pixels around the G pixel and the G are as shown in the equation [Equation 2].
  • Color correction is performed by multiplying the pixel data (G) of the pixel and the pixel data (B) of the B pixel around the G pixel by the first correction coefficient ( ⁇ 2, ⁇ 2, ⁇ 2) and adding the offset value ⁇ 2.
  • the pixel data (R) of the R pixels around the B pixel is used as shown in the equation [Equation 3].
  • the pixel data (G) of the G pixel around the B pixel and the pixel data (B) of the B pixel are multiplied by the first correction coefficient ( ⁇ 3, ⁇ 3, ⁇ 3), and the offset value ⁇ 3 is added.
  • the pixel data of the color-corrected G pixel is acquired.
  • the color of the RAW data of the correction frame can be matched to or close to the color of the reference frame.
  • this image processing device performs white balance correction unit 234 by multiplying R data, G data, and B data by WB gains Gr, Gg, and Gb according to the light source type, color temperature, and the like. Unlike, the image processing is independent of the light source type, the color temperature, and the like, and the color of the correction frame can be matched with the color of the reference frame regardless of the flicker of the light source.
  • the linear matrix processing unit of the digital signal processing unit 206 performs matrix calculation using a fixed coefficient of 3 ⁇ 3 for RGB color image data, and the first correction coefficient ( ⁇ 1, ⁇ 2, ⁇ 3, A value obtained by multiplying ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3) can be applied.
  • the offset processing unit of the digital signal processing unit 206 is a portion that corrects the influence of dark current by subtracting the signal component (offset value) generated in the optical black region of the image sensor 201. A value obtained by adding the first correction coefficient ( ⁇ 1, ⁇ 2, ⁇ 3) to the offset value can be applied.
  • the linear matrix processing unit and the offset processing unit can function as the first color correction unit 350.
  • FIG. 5 is a diagram showing an embodiment of a stacked CMOS showing an example of a hardware configuration of an image processing device.
  • the same reference numerals are given to the parts common to the image processing apparatus shown in FIG. 4, and detailed description thereof will be omitted.
  • the reference frame storage area 314 temporarily stores the reference frame
  • the correction frame storage area 316 temporarily stores the pixel data of the correction frame. From the reference frame storage area 314 and the correction frame storage area 316, the pixel data of the first reference image area (first reference color signal (R ref , R ref , G ref , B ref )) and the pixel data of the first corrected image region (first corrected color signal (R, G, B)) are read out in parallel and added to the first correction coefficient calculation unit 340.
  • the first correction coefficient calculation unit 340 includes a first reference color signal (R ref , G ref , B ref ) of the first reference image region, which is the same first image region read in parallel, and a first correction image. Based on the first correction color signal (R, G, B) of the region, the first correction coefficient that matches the first correction color signal of the first correction image area with the first reference color signal of the first reference image area is set. calculate.
  • the first color correction unit 350 performs correction processing using the first correction coefficient calculated by the first correction coefficient calculation unit 340 on the pixel data of the correction frame read from the correction frame storage area 316 and outputs the data.
  • the calculation time of the first correction coefficient is shortened by performing the calculation for each corresponding first image area of the reference frame and the correction frame in parallel, and the color correction of the correction frame can be executed in real time.
  • FIG. 6 is a block diagram showing a second embodiment of the image processing apparatus according to the present invention.
  • the frame specifying unit 311 shown in FIG. 6 does not specify the reference frame and the correction frame according to the flicker phase of the light source as in the first embodiment, but refers to, for example, the first frame at the time of capturing a moving image. It is possible to specify as a frame, specify a frame after that as a correction frame, or specify a frame specified by the user using the operation unit 222 as a reference frame, and specify other frames as a correction frame.
  • the method of specifying the reference frame and the correction frame is not limited to this. For example, a frame in which a main subject such as a person is first detected is used as a reference frame, and subsequent frames in which the main subject is imaged. Can be used as a correction frame.
  • the first image area determination unit 321 has an object detection unit 324, and determines a calculation area corresponding to an object in the frame detected by the object detection unit 324.
  • the object detection unit 324 extracts the feature amount of the image and detects one or more objects such as a person, a building, the sky, and the ground in the frame based on the extracted feature amount, and makes machine learning for object detection. You can use a learning device.
  • the first image area determination unit 321 determines the calculation area with reference to the object in the frame detected by the object detection unit 324. When a plurality of objects are detected, an object near the center of the screen or an object with a high priority can be selected.
  • FIG. 7 is a diagram showing an example of a reference frame F ref of a moving image captured outdoors and a correction frame F of a moving image captured indoors.
  • a person is detected as an object in the reference frame F ref and the correction frame F
  • the first image area determination unit 321 is a calculation area in the reference frame F ref with reference to the detected person.
  • the calculation area C in A and the correction frame F can be determined.
  • the first image area determination unit 321 determines n first reference image areas B1 to Bn in the calculation area A of the reference frame F ref , and n first correction images in the calculation area C of the correction frame F. Regions D1 to Dn are determined. In the example shown in FIG. 7, the first reference image areas B1 to Bn and the first corrected image areas D1 to Dn are regions at the same position, respectively. Further, in FIG. 7, only one first reference image area B1 and one first corrected image area D1 are shown, respectively.
  • the first color signal acquisition unit 330 is the first from the color image data of the first reference image areas B1 to Bn determined by the first image area determination unit 321 for each of the first reference image areas B1 to Bn. 1
  • the first corrected image area D1 from the color image data of the first corrected image areas D1 to Dn obtained by acquiring the reference color signals (R ref , G ref , B ref ) and similarly determined by the first image area determining unit 321.
  • the first correction color signal (R, G, B) is acquired for each of ⁇ Dn.
  • the first correction coefficient calculation unit 340 uses the first correction color signal (R, G, B) based on a plurality of pairs of the first reference color signals (R ref , G ref , B ref ) and the first correction color signal (R, G, B). First correction coefficients ( ⁇ 1 to ⁇ 3, ⁇ 1 to ⁇ 1 to ⁇ 3 of [Equation 1] to [Equation 3]] for matching R, G, B) with the first reference color signal (R ref , G ref , B ref ). ⁇ 3, ⁇ 1 to ⁇ 3, ⁇ 1 to ⁇ 3) are calculated.
  • the first color correction unit 350 corrects the first correction coefficient ( ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3, ⁇ 1, ⁇ 2, ⁇ 3) calculated by the first correction coefficient calculation unit 340. Apply to the frame and perform color correction of the correction frame.
  • the color of the subject is the color of the subject even if white balance correction is performed by multiplying the R data, G data, and B data by the WB gains Gr, Gg, and Gb corresponding to these light sources.
  • the taste is significantly different, according to the second embodiment, the moving image (subject in the calculation area C) captured indoors can be brought closer to the color of the subject in the calculation area A captured outdoors.
  • the color of the background area other than the calculation area C of the correction frame F does not necessarily approach the color of the background area other than the calculation area A of the reference frame Ref , but at least the subject (main subject) of the correction frame F is used.
  • the tint of the included calculation area C can be brought close to the tint of the calculation area A of the reference frame Ref .
  • FIG. 8 is a diagram showing an example of a reference frame F ref and a correction frame F prepared in advance.
  • the reference frame Ref shown in FIG. 8 includes a face image as an object image whose color to be matched, and the face area including this face image is defined as the calculation area A.
  • the object detection unit 324 (FIG. 6) detects a face image from the correction frame F, and the first image area determination unit 321 sets the face area including the face image detected by the object detection unit 324 as the calculation area C.
  • the object detection unit 324 has a face area included in the calculation area A of the reference frame F ref.
  • the face parts for example, eyes, nose, mouth, cheeks, forehead, chin, eyebrows, hair, etc.
  • the face parts are detected from the face parts, and similarly, the face parts are detected from the face area included in the calculation area C of the correction frame F.
  • the first image area determination unit 321 sets the area of each face part included in the calculation area A of the reference frame F ref detected by the object detection unit 324 as the first reference image area, and includes the area C in the calculation area C of the correction frame F.
  • the area of each face part can be set as the first corrected image area.
  • a specific subject in the correction frame can be adjusted to a predetermined preferred color of the specific subject. You can bring the color of.
  • FIG. 9 is a diagram schematically showing the relationship between the flicker of the light source, the exposure operation of the image sensor, and the moving image data.
  • the light source shown in FIG. 9 repeatedly blinks according to the frequency of the commercial power supply. Further, the image sensor 201 is driven by a rolling shutter method when capturing a moving image, and the timing of starting exposure is deviated for each scanning line of one frame.
  • the amount of incident light from the light source and the spectroscopic ratio of RGB during the exposure time differ depending on the position of the scanning line even within the same frame, and the tint varies depending on the scanning line even within the same frame. Change.
  • FIG. 10 is a block diagram showing a third embodiment of the image processing apparatus according to the present invention.
  • the image processing apparatus of the third embodiment shown in FIG. 10 corrects a change in color in the same frame, and mainly includes a moving image acquisition unit 303, a line image identification unit 410, and a second image area determination unit 420. It is composed of a second color signal acquisition unit 430, a second correction coefficient calculation unit 440, and a second color correction unit 450.
  • the RAW data 301 is moving image data obtained from the image pickup device 201 when the image pickup device 201 is driven by the rolling shutter method under a light source having a flicker as shown in FIG.
  • the moving image acquisition unit 303 acquires the RAW data 301, and outputs the acquired RAW data 301 to the line image identification unit 410 and the second color correction unit 450.
  • the line image specifying unit 410 specifies an image on the reference scanning line as a reference line image and an image on a scanning line adjacent to the reference scanning line image as a correction line image in each frame of the RAW data 301.
  • the first reference scanning line of each frame can be, for example, the first scanning line in one frame. Further, the first reference scanning line of each frame can be a scanning line that is less affected by flicker. A scanning line that is less affected by flicker is a scanning line that has a small change in the brightness of the light source during the exposure time of the scanning line.
  • the line image specifying unit 410 specifies the correction line image color-corrected by the second color correction unit 450, which will be described later, as a reference line image for the next adjacent correction line image.
  • the second image area determination unit 420 is a portion that determines an image area used for calculating the second correction coefficient in the line image from the reference line image and the correction line image specified by the line image identification unit 410, respectively.
  • the second reference image area is determined from the reference line image in each calculation area of the reference line image and the correction line image, and the second correction image area corresponding to the second reference image area is determined from the correction line image.
  • the second reference image area and the second corrected image area of this example can be regions at the same position in the line image, respectively.
  • the second reference image area can be, for example, an image area of a specific pixel or a peripheral pixel including a specific pixel at a plurality of preset pixel positions in the calculation area of the reference line image. It is desirable to select a plurality of specific pixels so as to include pixels in the entire area of the line image.
  • the second corrected image area is an area within the calculation area of the correction line image, and is an area corresponding to the second reference image area.
  • the reference line image and the correction line image of this example are line images on scanning lines adjacent to each other, and since the exposure times are close and the subject is highly correlated, it is easy to extract color changes.
  • the second color signal acquisition unit 430 is based on the color image data (in this example, RGB RAW data) of the second reference image area determined by the second image area determination unit 420, that is, the second reference image area of the RAW data.
  • the representative value of the pixel data of the R pixel, the representative value of the pixel data of the G pixel, and the representative value of the pixel data of the B pixel are set to the second reference color signal (R ref , G ref , for each of the plurality of second reference image areas. Obtained as B ref ).
  • the second color signal acquisition unit 430 uses the RGB RAW data of the second corrected image area determined by the second image area determination unit 420 in the same manner to obtain the pixel data of the R pixels of the second corrected image area of the RAW data.
  • the representative value, the representative value of the pixel data of the G pixel, and the representative value of the pixel data of the B pixel are acquired as the second corrected color signal (R, G, B) for each of the plurality of second corrected image regions.
  • the second correction coefficient calculation unit 440 calculates the second correction coefficient that matches the second correction color signal (R, G, B) with the second reference color signal (R ref , G ref , B ref ).
  • the calculation of the second correction coefficient can be performed in the same manner as the calculation of the first correction coefficient between frames.
  • the second color correction unit 450 applies the second correction coefficient ( ⁇ 1 to ⁇ 3, ⁇ 1 to ⁇ 3, ⁇ 1 to ⁇ 3, ⁇ 1 to ⁇ 3, ⁇ 1 to ⁇ 3) calculated by the second correction coefficient calculation unit 440 to the correction line image, and corrects the line. Perform color correction of the image.
  • the offset value ( ⁇ 1 to ⁇ 3) of the second correction coefficient can be omitted.
  • the second color correction unit 450 applies the second correction coefficient calculated for each line to the correction line image for each line of the RAW data 300 input from the moving image acquisition unit 303 to perform color correction and color correction. Output the correction line image.
  • the line image specifying unit 410 acquires a correction line image color-corrected by the second color correction unit 450 as a reference line image for the next correction line image.
  • FIG. 11 is a block diagram showing a fourth embodiment of the image processing apparatus according to the present invention.
  • the same reference numerals are given to the parts common to the image processing apparatus of the third embodiment shown in FIG. 10, and detailed description thereof will be omitted.
  • the image processing apparatus of the fourth embodiment shown in FIG. 11 corrects the change in color in the same frame as in the third embodiment, but mainly the reference line image and the correction line by the line image specifying unit 411.
  • the method of specifying the image and the method of determining the image area to be compared by the second image area determination unit 421 are different.
  • the line image specifying unit 411 specifies the line image on the reference scanning line as the reference line image and the line image on the scanning line other than the reference scanning line as the correction line image in each frame constituting the moving image data. ..
  • the reference scanning line can be a scanning line that is less affected by flicker.
  • the second image region determination unit 421 is a portion that determines an image region used for calculating the second correction coefficient in the line image from the reference line image and the correction line image specified by the line image identification unit 411.
  • the second reference image area is determined from the reference line image in each calculation area of the reference line image and the correction line image, and the second correction image area corresponding to the second reference image area is determined for each correction line image.
  • the second image area determination unit 421 has a scanning line direction in which the colors of the reference line image and the correction line image are similar to each other. A plurality of image regions including pixels in the horizontal direction) are determined. To determine whether the colors are similar, for example, (RG) / (BG) is calculated from the pixel data (R, G, B), and the difference between the calculation results is less than the reference value. It can be done depending on whether or not.
  • the RAW data is used as the input data, for example, when the specific pixel to be compared is the pixel data of the R pixel, the pixel data of the G pixel and the B pixel in the vicinity of the R pixel are used to color. Judge whether they are similar or not.
  • the second image area determination unit 421 includes an object detection unit 424 that detects an object such as a face image from the frame.
  • the second image area determination unit 421 is an image of a correction line image that includes the same objects as the objects included in the second reference image area of the reference line image detected by the object detection unit 424 and includes pixels having similar colors. It is desirable to determine the region as the second corrected image region.
  • the specific pixel used for the color correction can be determined.
  • the image processing apparatus of the first embodiment or the second embodiment corrects the change in color between frames.
  • the present invention is not limited to this, for example, the moving image data after the linear matrix processing and the simultaneous RGB data after the demosaic processing.
  • the YCrCb data obtained by converting the RGB data simultaneous by the RGB / YCrCb conversion process into the brightness data (Y) and the color difference data (Cr, Cb) may be used as the moving image data to be corrected.
  • the image sensor is not limited to one provided with an RGB color filter, and may include other colors such as yellow and emerald.
  • FIG. 12 is a flowchart showing an embodiment of the image processing method according to the present invention.
  • the image processing method shown in FIG. 12 corresponds to the image processing apparatus of the first embodiment shown in FIG.
  • the main body side CPU 220 is set to a second moving image imaging mode for capturing a moving image for still image extraction, and an instruction input for starting to capture a moving image is input from the shutter release switch 22 during standby for moving image imaging. It is determined whether or not there is (step S10).
  • the CPU 220 on the main body side receives the instruction input for starting the imaging of the moving image, the CPU 220 drives the imaging element 201 via the image sensor control unit 202 to capture the moving image for still image extraction, and the captured moving image.
  • the RAW data which is data, is subjected to image processing by the digital signal processing unit 206 that functions as an image processing device.
  • the moving image acquisition unit 302 of the image processing device shown in FIG. 4 acquires RAW data 300 for one frame (step S12).
  • the frame specifying unit 310 identifies whether one frame acquired by the moving image acquisition unit 302 is a reference frame or a correction frame among a plurality of frames constituting the moving image, and identifies the specified reference frame or correction. Acquire a frame (step S14).
  • the reference frame or the correction frame can be specified based on the flicker phase detected by the flicker phase detection unit 312.
  • the first image area determination unit 320 determines a plurality of first reference image areas used for calculating the first correction coefficient from the reference frame specified by the frame identification unit 310, and from the correction frame specified by the frame identification unit 310. A plurality of first corrected image regions corresponding to the plurality of first reference image regions are determined (step S16).
  • the first color signal acquisition unit 330 uses the RAW data of the plurality of first reference image regions determined by the first image region determination unit 320 to obtain the first reference color signal (R ref , Gr ref) for each first reference image region. , B ref ), and the first corrected color signal (R, G, B) is acquired for each first corrected image area from the RAW data of the plurality of first corrected image areas (step S18).
  • the first correction coefficient calculation unit 340 includes a plurality of pairs of first reference color signals (R ref , G ref , B ref ) and first correction color signals (R, G, B) acquired by the first color signal acquisition unit 330. ), The first correction coefficient for matching the first correction color signal (R, G, B) with the first reference color signal (R ref , G ref , B ref ) ([Equation 1] equation to [ ⁇ 1 to ⁇ 3, ⁇ 1 to ⁇ 3, ⁇ 1 to ⁇ 3, ⁇ 1 to ⁇ 3, ⁇ 1 to ⁇ 3) of the equation (Equation 3) are calculated (step S20).
  • the first color correction unit 350 applies the first correction coefficient calculated by the first correction coefficient calculation unit 340 to the correction frame input from the moving image acquisition unit 302, and performs color correction of the correction frame (step S22). ). By color correction for this correction frame, the color tone of the correction frame can be brought close to the color tone of the reference frame.
  • the CPU 220 on the main body side determines whether or not there is an instruction input from the shutter release switch 22 to end the imaging of the moving image (step S24). If there is no instruction input to end the imaging of the moving image, the CPU 220 on the main body side transitions to step S12. As a result, the processes of steps S12 to S24 are executed for the next frame. On the other hand, when the instruction input for the end of imaging of the moving image is received, the imaging of the moving image and the image processing in the second moving image imaging mode are terminated.
  • the RAW data acquired by imaging the moving image is corrected in real time.
  • the RAW data is temporarily recorded on the storage medium (memory card 212 or flash ROM 226). After that, the RAW data may be read from the storage medium and the correction process may be performed.
  • the image pickup device 10 of the present embodiment is a mirrorless digital single-lens camera, but is not limited to this, and may be a single-lens reflex camera, a lens-integrated image pickup device, a digital video camera, or the like. It can also be applied to mobile devices having other functions (call function, communication function, other computer functions). Other aspects to which the present invention can be applied include, for example, mobile phones and smartphones having a camera function, PDAs (Personal Digital Assistants), and portable game machines. Hereinafter, an example of a smartphone to which the present invention can be applied will be described.
  • FIG. 13 shows the appearance of the smartphone 500, which is an embodiment of the imaging device of the present invention.
  • the smartphone 500 shown in FIG. 13 has a flat-plate housing 502, and a display input in which a display panel 521 as a display unit and an operation panel 522 as an input unit are integrated on one surface of the housing 502.
  • the unit 520 is provided.
  • the housing 502 includes a speaker 531, a microphone 532, an operation unit 540, and a camera unit 541.
  • the configuration of the housing 502 is not limited to this, and for example, a configuration in which the display unit and the input unit are independent can be adopted, or a configuration having a folding structure or a slide mechanism can be adopted.
  • FIG. 14 is a block diagram showing the configuration of the smartphone 500 shown in FIG.
  • the main components of the smartphone are a wireless communication unit 510, a display input unit 520, a call unit 530, an operation unit 540, a camera unit 541, a storage unit 550, and an external input / output unit. It includes a 560, a GPS receiving unit 570 (GPS: Global Positioning System), a motion sensor unit 580, a power supply unit 590, and a main control unit 501.
  • the main control unit 501 functions as a moving image acquisition unit, a frame identification unit, a first image area determination unit, a first color signal acquisition unit, a first correction coefficient calculation unit, and a first color correction unit.
  • the wireless communication unit 510 performs wireless communication to the base station accommodated in the mobile communication network according to the instruction of the main control unit 501. This wireless communication is used to send and receive various file data such as voice data and image data, e-mail data, and receive Web data and streaming data.
  • the display input unit 520 displays images (still images and moving images), character information, and the like to visually convey the information to the user, and detects the user operation for the displayed information. It is a so-called touch panel, and includes a display panel 521 and an operation panel 522.
  • the operation panel 522 is a device on which an image displayed on the display surface of the display panel 521 is visibly placed and detects one or a plurality of coordinates operated by a user's finger, a pen, or the like.
  • a detection signal generated due to the operation is output to the main control unit 501.
  • the main control unit 501 detects the operation position (coordinates) on the display panel 521 based on the received detection signal.
  • the display panel 521 and the operation panel 522 of the smartphone 500 illustrated as one embodiment of the image pickup apparatus of the present invention integrally constitute the display input unit 520, but the operation panel
  • the arrangement is such that the 522 completely covers the display panel 521.
  • the operation panel 522 may also have a function of detecting a user operation in an area outside the display panel 521.
  • the operation panel 522 has a detection area (hereinafter, referred to as a display area) for the overlapping portion overlapping the display panel 521 and a detection area (hereinafter, non-display area) for the outer edge portion not overlapping the other display panel 521. ) And may be provided.
  • the call unit 530 includes a speaker 531 and a microphone 532, converts the user's voice input through the microphone 532 into voice data that can be processed by the main control unit 501, and outputs the data to the main control unit 501.
  • the audio data received by the 510 or the external input / output unit 560 can be decoded and output from the speaker 531.
  • the speaker 531 can be mounted on the same surface as the surface on which the display input unit 520 is provided, and the microphone 532 can be mounted on the side surface of the housing 502.
  • the operation unit 540 is a hardware key using a key switch or the like, and is a device that receives instructions from the user.
  • the operation unit 540 is mounted on the side surface of the housing 502 of the smartphone 500, and is turned on when pressed with a finger or the like, and turned off by a restoring force such as a spring when the finger is released. It is a button type switch.
  • the storage unit 550 includes a control program of the main control unit 501, control data, application software (including a program that realizes the image processing method according to the present invention), address data associated with the name and telephone number of a communication partner, and transmission / reception.
  • the data of the e-mail, the Web data downloaded by Web browsing, and the downloaded content data are stored, and the streaming data and the like are temporarily stored.
  • the storage unit 550 is composed of an internal storage unit 551 built in the smartphone and an external storage unit 562 having a detachable external memory slot. Each of the internal storage unit 551 and the external storage unit 552 constituting the storage unit 550 is realized by using a known storage medium.
  • the external input / output unit 560 serves as an interface with all external devices connected to the smartphone 500.
  • the smartphone 500 is directly or indirectly connected to another external device via an external input / output unit 560 by communication or the like.
  • Examples of means for communication and the like include a universal serial bus (USB: Universal Seal Bus), IEEE 1394, and a network (for example, the Internet and a wireless LAN (Local Area Network).
  • Bluetooth registered trademark
  • RFID Radio Frequency Identification
  • IrDA Infrared Data Association
  • UWB Ultra Wideband
  • ZigBee registered trademark
  • Examples of external devices connected to the smartphone 500 include a wired / wireless headset, a wired / wireless external charger, a wired / wireless data port, a memory card (Memory card) connected via a card socket, and a SIM (SIM). Subscriber Identity Module Card) / UIM (User Identity Module Card) cards can be mentioned.
  • external audio and video equipment connected via an audio and video I / O (Input / Output) terminal, external audio and video equipment wirelessly connected, smartphones wired / wirelessly connected, and wired / wirelessly connected.
  • External devices such as PDAs, wired / wirelessly connected personal computers, and earphones can also be connected.
  • the external input / output unit 560 can transmit the data transmitted from such an external device to each component inside the smartphone 500, and can transmit the data inside the smartphone 500 to the external device.
  • the motion sensor unit 580 is provided with, for example, a three-axis acceleration sensor or an inclination sensor, and detects the physical movement of the smartphone 500 according to the instruction of the main control unit 501 to determine the moving direction and acceleration of the smartphone 500. The posture is detected. The detection result is output to the main control unit 501.
  • the power supply unit 590 supplies electric power stored in a battery (not shown) to each unit of the smartphone 500 according to the instruction of the main control unit 501.
  • the main control unit 501 includes a microprocessor, operates according to the control program and control data stored in the storage unit 550, and controls each part of the smartphone 500 in an integrated manner.
  • the main control unit 501 includes a mobile communication control function that controls each unit of the communication system and an application processing function in order to perform voice communication and data communication through the wireless communication unit 510.
  • the main control unit 501 is provided with an image processing function such as displaying an image on the display input unit 520 based on image data (still image or moving image data) such as received data or downloaded streaming data.
  • the image processing function refers to a function in which the main control unit 501 decodes the image data, performs image processing on the decoding result, and displays the image on the display input unit 520.
  • the camera unit 541 corresponds to a digital camera that electronically photographs using an image sensor such as CMOS or CCD, or an image pickup device 10 shown in FIG. Further, the camera unit 541 converts the image data (moving image, still image) obtained by imaging into compressed image data such as MPEG or JPEG under the control of the main control unit 501, and records the image data in the storage unit 550. Alternatively, it can be output through the external input / output unit 560 or the wireless communication unit 510.
  • the camera unit 541 can be used for various functions of the smartphone 500.
  • the image acquired by the camera unit 541 can be displayed on the display panel 521, or the image of the camera unit 541 can be used as one of the operation inputs of the operation panel 522.
  • the GPS receiving unit 570 detects the position
  • the position can be detected by referring to the image from the camera unit 541.
  • the optical axis direction of the camera unit 541 of the smartphone 500 can be determined without using the 3-axis acceleration sensor or in combination with the 3-axis acceleration sensor. You can also judge the current usage environment.
  • the image from the camera unit 541 can also be used in the application software.
  • the image data of the still image or the moving image, the position information acquired by the GPS receiving unit 570, and the voice information acquired by the microphone 532 may perform voice text conversion to obtain text information).
  • the posture information acquired by the motion sensor unit 580 can be added and recorded in the storage unit 550, or can be output through the external input / output unit 560 or the wireless communication unit 510.
  • the camera unit 541 is mounted on the same surface as the display input unit 520, but the mounting position of the camera unit 541 is not limited to this, and is mounted on the back surface of the display input unit 520.
  • a plurality of camera units 541 may be mounted.
  • the camera units 541 used for shooting can be switched for shooting independently, or the plurality of camera units 541 can be used at the same time for shooting.
  • the image processing device of the present embodiment is built in the image pickup device 10, but may be an image processing device configured by an external computer or the like.
  • the present invention records an image processing program that causes these computers to function as an image processing device according to the present invention by being installed in a computer inside the imaging device or an external computer, and the image processing program. Includes storage medium.
  • the first correction coefficient and the second correction coefficient are calculated in the image pickup apparatus, and the calculated first correction coefficient and the second correction coefficient are applied to the correction frames to obtain or the same color tone between the frames.
  • the color tone in the frame is corrected in real time, but the present invention is not limited to this.
  • acquisition of moving image data (RAW data) and correction coefficients (first correction coefficient, or first correction coefficient and second correction coefficient) are performed.
  • (Correction coefficient) is calculated, the moving image data and the correction coefficient are saved in association with each other, and the imaging device acquires the moving image data and the correction coefficient in the correction mode or the like, or an external device such as a computer obtains the moving image data.
  • the correction coefficient may be acquired to correct the tint between frames of the moving image data or the tint within the same frame. In this case, the correction coefficient may be recorded in the header of the moving image file or in another file associated with the moving image file.
  • color correction can be performed between the same area of the reference frame and the correction frame, or color correction can be performed between the same subject of the reference frame and the correction frame detected by object detection.
  • the hardware structure of the processing unit (passing unit) that executes various processes is the following various processors (processors).
  • processors processors
  • the circuit configuration can be changed after manufacturing CPU (Central Processing Unit), FPGA (Field Programmable Gate Array), etc., which are general-purpose processors that execute software (programs) and function as various processing units.
  • CPU Central Processing Unit
  • FPGA Field Programmable Gate Array
  • a dedicated electric circuit which is a processor having a circuit configuration specially designed for executing a specific process such as a programmable logic device (PLD), an ASIC (Application Specific Integrated Circuit), etc. Is done.
  • One processing unit may be composed of one of these various processors, or may be composed of two or more processors of the same type or different types (for example, a plurality of FPGAs or a combination of a CPU and an FPGA). You may. Further, a plurality of processing units may be configured by one processor. As an example of configuring a plurality of processing units with one processor, first, one processor is configured by a combination of one or more CPUs and software, as represented by a computer such as a client or a server. There is a form in which a processor functions as a plurality of processing units.
  • SoC system on chip
  • a processor that realizes the functions of the entire system including a plurality of processing units with one IC (Integrated Circuit) chip is used.
  • IC Integrated Circuit
  • the various processing units are configured by using one or more of the above-mentioned various processors as a hardware-like structure.
  • the hardware structure of these various processors is, more specifically, an electric circuit (cyclery) in which circuit elements such as semiconductor elements are combined.
  • Imaging device 10
  • Finder window 22
  • Shutter release switch 23
  • Shutter speed dial 24
  • Exposure compensation dial 25
  • Power lever 26
  • Eyepiece 27
  • MENU / OK key 28
  • Cross key 29 Play button 30
  • Built-in flash 100
  • Interchangeable lens 102
  • Imaging optical system 104
  • Lens group 108
  • Aperture 116
  • Focus lens control unit 118
  • Aperture control unit 120
  • Lens side CPU 122, 207 RAM 124, 228
  • ROM 126 flash ROM 150
  • Lens mount 160
  • Camera body 201
  • Image sensor 202
  • Image sensor control unit 203
  • Analog signal processing unit 204
  • Image input controller 206
  • Digital signal processing unit 208
  • Compression / decompression processing unit 210
  • Memory Card 214
  • Display control unit 216
  • Main unit CPU 222
  • Operation unit 226
  • Flash ROM 230
  • AF detection unit 232
  • AE control unit 234

Abstract

光源の変化に伴って動画像のフレーム間で異なる色補正を行う画像処理装置、撮像装置、画像処理方法及び画像処理プログラムを提供する。画像処理装置は、動画像データを取得する動画像取得部(302)と、動画像データを構成する複数のフレームより基準フレームと補正フレームを特定するフレーム特定部(310)と、フレーム内の第1補正係数の算出に用いる画像領域を決定する第1画像領域決定部であって、基準フレームより第1基準画像領域を決定し、補正フレームより第1基準画像領域に対応する第1補正画像領域を決定する第1画像領域決定部(320)と、第1基準画像領域の色画像データより第1基準色信号を取得し、第1補正画像領域の色画像データより第1補正色信号を取得する第1色信号取得部(330)と、第1補正色信号を第1基準色信号に合わせる第1補正係数を算出する第1補正係数算出部(340)と、を備える。

Description

画像処理装置、撮像装置、画像処理方法及び画像処理プログラム
 本発明は画像処理装置、撮像装置、画像処理方法及び画像処理プログラムに係り、特に光源の変化に伴って動画像のフレーム間で異なる色補正を行う技術に関する。
 特許文献1に記載の画像処理装置は、フリッカの除去を行う補正対象画像の行単位の信号量の積分値を算出し、この積分値を適用して画像フレームの各行に含まれるフリッカ成分を検出する。この検出フリッカ成分は実際の照明のフリッカ波形に応じたデータである。このフリッカ成分の逆相パターンからなるフリッカ補正係数を適用した補正処理を実行することによりフリッカ除去を行う。
 また、特許文献2に記載の画像補正装置は、CMOSイメージセンサを用い、ローリングシャッタにて撮像を行う撮像装置において、CMOSイメージセンサの出力によって表される原画像のフリッカを補正するフリッカ補正回路を備える。フリッカ補正回路の領域補正係数算出回路は、原画像を垂直方向にM分割すると共に水平方向にN分割し、分割領域ごとに画素信号を平均化することにより領域平均値を算出し、分割領域ごとに複数フレーム分の領域平均値の平均を算出することによりフリッカ成分を含まない領域基準値を算出する。フリッカ補正回路は、領域基準値と原画像の領域平均値との比から算出した領域補正係数を用いて原画像を補正する。
特開2011-160090号公報 特開2008-109370号公報
 本開示の技術に係る一つの実施形態は、光源の変化に伴って動画像のフレーム間で異なる色補正を行う画像処理装置、撮像装置、画像処理方法及び画像処理プログラムを提供する。
 本発明の一の態様に係る画像処理装置は、1つ以上のプロセッサを含み、1つ以上のプロセッサは、撮像素子が撮像した動画像データを取得する動画像取得処理と、動画像取得処理で取得した動画像データを構成する複数のフレームより基準フレームと基準フレームに対する補正フレームを特定するフレーム特定処理と、フレーム内の第1補正係数の算出に用いる画像領域を決定し、基準フレームより第1基準画像領域を決定し、補正フレームより第1基準画像領域に対応する第1補正画像領域を決定する第1画像領域決定処理と、第1基準画像領域の色画像データより第1基準色信号を取得し、第1補正画像領域の色画像データより第1補正色信号を取得する第1色信号取得処理と、第1補正色信号を第1基準色信号に合わせる第1補正係数を算出する第1補正係数算出処理と、を実行するように構成されている。
 本発明の他の態様に係る画像処理装置において、1つ以上のプロセッサは、第1補正係数算出処理により算出された第1補正係数を補正フレームに適用して補正フレームの色補正を行う第1色補正処理を更に実行するように構成されていることが好ましい。
 本発明の更に他の態様に係る画像処理装置において、第1画像領域決定処理により決定される第1基準画像領域及び第1補正画像領域はそれぞれ複数の画像領域であり、かつ各画像領域は特定画素又は特定画素を含む周辺画素の画像領域であることが好ましい。
 本発明の更に他の態様に係る画像処理装置において、第1基準色信号及び第1補正色信号は、それぞれ複数の色信号から構成されること好ましい。
 本発明の更に他の態様に係る画像処理装置において、第1基準色信号の複数の色信号を赤色のRref、緑色のGref、青色のBrefとし、第1補正色信号の複数の色信号を赤色のR、緑色のG、青色のBとすると、第1補正係数算出処理は、複数の画像領域において、次式、
 Rref=α1・R+β1・G+γ1・B+Δ1
 Gref=α2・R+β2・G+γ2・B+Δ2
 Bref=α3・R+β3・G+γ3・B+Δ3
を成立させる第1補正係数であるα1、α2、α3、β1、β2、β3、γ1、γ2、γ3、Δ1、Δ2、Δ3を算出することが好ましい。
 本発明の更に他の態様に係る画像処理装置において、第1補正係数算出処理は、複数の画像領域において、RrefとR、GrefとG、及びBrefとBの差がそれぞれ最小になるα1、α2、α3、β1、β2、β3、γ1、γ2、γ3、Δ1、Δ2、Δ3を算出することが好ましい。
 本発明の更に他の態様に係る画像処理装置において、動画像データは、撮像素子上に形成される画素に対し、少なくとも1つ以上の画素毎又は走査ライン毎に順次露光動作が行われて撮像されたものであり、第1画像領域決定処理は、基準フレーム及び補正フレームにおいて、撮像素子の露光開始と露光終了のタイミングが同じ画像領域からそれぞれ第1基準画像領域及び第1補正画像領域を決定することが好ましい。
 本発明の更に他の態様に係る画像処理装置において、第1画像領域決定処理は、基準フレームにおける第1基準画像領域と補正フレームにおける第1補正画像領域とをフレーム内の同じ位置とすることが好ましい。
 本発明の更に他の態様に係る画像処理装置において、1つ以上のプロセッサは、動画像データより光源のフリッカの位相を検出するフリッカ位相検出処理を実行するように構成され、フレーム特定処理は、フリッカの位相を用いて基準フレームを特定することが好ましい。
 本発明の更に他の態様に係る画像処理装置において、フレーム特定処理は、第1色補正処理により色補正された補正フレームを、次の補正フレームに対する基準フレームとして特定することが好ましい。
 本発明の更に他の態様に係る画像処理装置において、動画像取得処理は、フレーム間隔よりも1フレーム当りの露光時間が短い複数のフレームから構成される動画像データを取得することが好ましい。
 本発明の更に他の態様に係る画像処理装置において、動画像データは、フリッカを有する光源下で撮像素子上に形成される画素に対し、少なくとも1つ以上の画素毎又は走査ライン毎に順次露光動作が行われて撮像されたものであり、動画像取得処理は、1フレーム当りの露光時間がフレーム間隔よりも短く、かつ光源のフリッカの周期よりも短い複数のフレームから構成される動画像データを取得し、1つ以上のプロセッサは、動画像データを構成する各フレームにおいて、基準走査ライン上のライン画像を基準ライン画像として特定し、基準走査ラインに隣接する走査ライン上のライン画像を補正ライン画像として特定するライン画像特定処理と、ライン画像内の第2補正係数の算出に用いる画像領域を決定し、基準ライン画像より第2基準画像領域を決定し、補正ライン画像より第2基準画像領域に対応する第2補正画像領域を決定する第2画像領域決定処理と、第2基準画像領域の色画像データより第2基準色信号を取得し、第2補正画像領域の色画像データより第2補正色信号を取得する第2色信号取得処理と、第2補正色信号を第2基準色信号に合わせる第2補正係数を算出する第2補正係数算出処理と、第2補正係数算出処理により算出された第2補正係数を補正ライン画像に適用して補正ライン画像の色補正を行う第2色補正処理と、を実行するように構成され、ライン画像特定処理は、第2色補正処理により色補正された補正ライン画像を、次の補正ライン画像に対する基準ライン画像として特定することが好ましい。
 本発明の更に他の態様に係る画像処理装置において、動画像データは、フリッカを有する光源下で撮像素子上に形成される画素に対し、少なくとも1つ以上の画素毎又は走査ライン毎に順次露光動作が行われて撮像されたものであり、動画像取得処理は、1フレーム当りの露光時間がフレーム間隔よりも短く、かつ光源のフリッカの周期よりも短い複数のフレームから構成される動画像データを取得し、1つ以上のプロセッサは、動画像データを構成する各フレームにおいて、基準走査ライン上のライン画像を基準ライン画像として特定し、基準走査ライン以外の走査ライン上のライン画像を補正ライン画像として特定するライン画像特定処理と、ライン画像内の第2補正係数の算出に用いる画像領域を決定し、基準ライン画像より第2基準画像領域を決定し、補正ライン画像毎に第2基準画像領域に対応する第2補正画像領域を決定する第2画像領域決定処理と、第2基準画像領域の色画像データより第2基準色信号を取得し、第2補正画像領域の色画像データより第2補正色信号を取得する第2色信号取得処理と、第2補正色信号を第2基準色信号に合わせる第2補正係数を算出する第2補正係数算出処理と、算出された第2補正係数を補正ライン画像に適用して補正ライン画像の色補正を行う第2色補正処理と、を実行するように構成され、第2画像領域決定処理は、補正ライン画像内の、基準ライン画像の第2基準画像領域の色と色が近似する画像領域を第2補正画像領域として決定することが好ましい。
 本発明の更に他の態様に係る画像処理装置において、1つ以上のプロセッサは、フレームからオブジェクトを検出するオブジェクト検出処理を実行するように構成され、第2画像領域決定処理は、オブジェクト検出処理により検出された、基準ライン画像の第2基準画像領域に含まれるオブジェクトと同じオブジェクトを含む、補正ライン画像の画像領域を第2補正画像領域として決定することが好ましい。
 本発明の更に他の態様に係る撮像装置は、動画像を撮像する撮像素子と、上記の何れかに記載の画像処理装置と、を備え、動画像取得処理は、撮像素子が撮像した動画像を示す動画像データを取得する。
 本発明の更に他の態様に係る画像処理方法は、撮像素子が撮像した動画像データを取得するステップと、動画像データを構成する複数のフレームより基準フレームと基準フレームに対する補正フレームを特定するステップと、フレーム内の第1補正係数の算出に用いる画像領域を決定し、基準フレームより複数の第1基準画像領域を決定し、補正フレームより複数の第1基準画像領域に対応する複数の第1補正画像領域を決定するステップと、複数の第1基準画像領域毎の色画像データより複数の第1基準色信号を取得し、複数の第1補正画像領域毎の色画像データより複数の第1補正色信号を取得するステップと、複数の第1補正色信号を複数の第1基準色信号に合わせる第1補正係数を算出するステップと、算出された第1補正係数を補正フレームに適用して補正フレームの色補正を行うステップと、を含む。
 本発明の更に他の態様に係る画像処理方法において、第1基準色信号を赤色のRref、緑色のGref、青色のBrefとし、第1補正色信号を赤色のR、緑色のG、青色のBとすると、第1補正係数を算出するステップは、複数の画像領域において、次式、
 Rref=α1・R+β1・G+γ1・B+Δ1
 Gref=α2・R+β2・G+γ2・B+Δ2
 Bref=α3・R+β3・G+γ3・B+Δ3
を成立させる第1補正係数であるα1、α2、α3、β1、β2、β3、γ1、γ2、γ3、Δ1、Δ2、Δ3を算出することが好ましい。
 本発明の更に他の態様に係る画像処理方法において、第1補正係数を算出するステップは、複数の画像領域において、RrefとR、GrefとG、及びBrefとBの差がそれぞれ最小になるα1、α2、α3、β1、β2、β3、γ1、γ2、γ3、Δ1、Δ2、Δ3を算出することが好ましい。
 本発明の更に他の態様に係る画像処理プログラムは、撮像素子が撮像した動画像データを取得する機能と、動画像データを構成する複数のフレームより基準フレームと基準フレームに対する補正フレームを特定する機能と、フレーム内の第1補正係数の算出に用いる画像領域を決定し、基準フレームより複数の第1基準画像領域を決定し、補正フレームより複数の第1基準画像領域に対応する複数の第1補正画像領域を決定する機能と、複数の第1基準画像領域毎の色画像データより複数の第1基準色信号を取得し、複数の第1補正画像領域毎の色画像データより複数の第1補正色信号を取得する機能と、複数の第1補正色信号を複数の第1基準色信号に合わせる第1補正係数を算出する機能と、算出された第1補正係数を補正フレームに適用して補正フレームの色補正を行う機能と、をコンピュータにより実現させる。
図1は、本発明に係る振れ補正装置を含む撮像装置を斜め前方から見た斜視図である。 図2は、図1に示した撮像装置の背面図である。 図3は、図1に示した撮像装置の内部構成の実施形態を示すブロック図である。 図4は、本発明に係る画像処理装置の第1実施形態を示すブロック図である。 図5は、画像処理装置のハードウェア構成の一例を示す積層型CMOSの実施形態を示す図である。 図6は、本発明に係る画像処理装置の第2実施形態を示すブロック図である。 図7は室外で撮像された動画像の基準フレームFrefと屋内で撮像された動画像の補正フレームFの一例を示す図である。 図8は事前に準備した基準フレームFrefと補正フレームFの一例を示す図である。 図9は光源のフリッカと撮像素子の露光動作と動画像データとの関係を模式的に示した図である。 図10は、本発明に係る画像処理装置の第3実施形態を示すブロック図である。 図11は、本発明に係る画像処理装置の第4実施形態を示すブロック図である。 図12は、本発明に係る画像処理方法の実施形態を示すフローチャートである。 図13は、本発明に係る撮像装置の一実施形態であるスマートフォンの外観図である。 図14は、スマートフォンの構成を示すブロック図である。
 以下、添付図面に従って本発明に係る画像処理装置、撮像装置、画像処理方法及び画像処理プログラムの好ましい実施形態について説明する。
 <撮像装置の外観>
 図1は、本発明に係る画像処理装置を含む撮像装置を斜め前方から見た斜視図であり、図2は図1に示した撮像装置の背面図である。
 図1に示すように撮像装置10は、交換レンズ100と、交換レンズ100が着脱可能なカメラ本体200とから構成されたミラーレスのデジタル一眼カメラである。
 図1において、カメラ本体200の前面には、交換レンズ100が装着される本体マウント260と、光学ファインダのファインダ窓20等が設けられ、カメラ本体200の上面には、主としてシャッタレリーズスイッチ22、シャッタスピードダイヤル23、露出補正ダイヤル24、電源レバー25、及び内蔵フラッシュ30が設けられている。
 また、図2に示すようにカメラ本体200の背面には、主として液晶モニタ216、光学ファインダの接眼部26、MENU/OKキー27、十字キー28、再生ボタン29等が設けられている。
 液晶モニタ216は、撮像モード時にライブビュー画像を表示し、再生モード時に撮像した画像を再生表示する他、各種のメニュー画面を表示する表示部として機能し、またユーザに対して各種の情報を通知する通知部として機能する。
 MENU/OKキー27は、液晶モニタ216の画面上にメニューを表示させる指令を行うためのメニューボタンとしての機能と、選択内容の確定及び実行などを指令するOKボタンとしての機能とを兼備した操作キーである。
 十字キー28は、上下左右の4方向の指示を入力する操作部であり、メニュー画面から項目を選択し、各メニューから各種設定項目の選択を指示するマルチファンクションキーとして機能する。また、十字キー28の上キー及び下キーは撮像時のズームスイッチあるいは再生モード時の再生ズームスイッチとして機能し、左キー及び右キーは再生モード時のコマ送り(順方向及び逆方向送り)ボタンとして機能する。また、液晶モニタ216に表示された複数の被写体から焦点調節あるいは色補正する所望の被写体を指定する操作部としても機能する。
 また、MENU/OKキー27、十字キー28、及び液晶モニタ216に表示されるメニュー画面を使用することで、1枚の静止画像を撮像する静止画像撮像モードの他に、通常の動画像を撮像する動画像撮像モード(第1動画像撮像モード)、動画像撮像モードの一種であって、静止画像抽出用の動画像を撮像する動画像撮像モード(第2動画像撮像モード)を含む各種の撮像モードの設定を行うことができる。
 尚、第2動画像撮像モードは、静止画像の抽出に適した撮像条件を設定し、動画像から高画質の静止画像を抽出するためのモードであり、例えば、動画像のフレーム間隔よりも1フレーム当りの露光時間が短く設定される。
 再生ボタン29は、撮像記録した静止画像又は動画像を液晶モニタ216に表示させる再生モードに切り替えるためのボタンである。
 <撮像装置の内部構成>
 [交換レンズ]
 図3は、撮像装置10の内部構成の実施形態を示すブロック図である。
 撮像装置10を構成する撮像光学系として機能する交換レンズ100は、カメラ本体200の通信規格に沿って製造されたものであり、後述するようにカメラ本体200との間で通信を行うことができる交換レンズである。この交換レンズ100は、撮像光学系102、フォーカスレンズ制御部116、絞り制御部118、レンズ側CPU(Central Processing Unit)120、フラッシュROM(Read Only Memory)126、レンズ側通信部150、及びレンズマウント160を備える。
 交換レンズ100の撮像光学系102は、フォーカスレンズを含むレンズ群104及び絞り108を含む。
 フォーカスレンズ制御部116は、レンズ側CPU120からの指令にしたがってフォーカスレンズを移動させ、フォーカスレンズの位置(合焦位置)を制御する。絞り制御部118は、レンズ側CPU120からの指令にしたがって絞り108を制御する。
 レンズ側CPU120は、交換レンズ100を統括制御するもので、ROM124及びRAM(Random Access Memory)122を内蔵している。
 フラッシュROM126は、カメラ本体200からダウンロードされたプログラム等を格納する不揮発性のメモリである。
 レンズ側CPU120は、ROM124又はフラッシュROM126に格納された制御プログラムに従い、RAM122を作業領域として、交換レンズ100の各部を統括制御する。
 レンズ側通信部150は、レンズマウント160がカメラ本体200の本体マウント260に装着されている状態で、レンズマウント160に設けられた複数の信号端子を介してカメラ本体200との通信を行う。即ち、レンズ側通信部150は、レンズ側CPU120の指令にしたがって、レンズマウント160及び本体マウント260を介して接続されたカメラ本体200の本体側通信部250との間で、リクエスト信号、回答信号の送受信(双方向通信)を行い、撮像光学系102の各光学部材のレンズ情報(フォーカスレンズの位置情報及び絞り情報等)を、カメラ本体200に通知する。
 また、交換レンズ100は、フォーカスレンズの位置情報、及び絞り情報を検出する検出部(図示せず)を備えている。ここで、絞り情報とは、絞り108の絞り値(F値)、絞り108の開口径等を示す情報である。
 レンズ側CPU120は、カメラ本体200からのレンズ情報のリクエストに応えるために、検出されたフォーカスレンズの位置情報及び絞り情報を含む各種のレンズ情報をRAM122に保持することが好ましい。また、レンズ情報は、カメラ本体200からのレンズ情報の要求があると検出され、又は光学部材が駆動されるときに検出され、又は一定の周期(動画像のフレーム周期よりも十分に短い周期)で検出され、検出結果を保持することができる。
 [カメラ本体]
 図3に示す撮像装置10を構成するカメラ本体200は、撮像素子201、撮像素子制御部202、アナログ信号処理部203、A/D(Analog to Digital)変換器204、画像入力コントローラ205、デジタル信号処理部206、RAM207、圧縮伸張処理部208、メディア制御部210、メモリカード212、表示制御部214、液晶モニタ216、本体側CPU220、操作部222、フラッシュROM226、ROM228、AF(Autofocus)制御部230、AE(Auto Exposure)制御部232、ホワイトバランス補正部234、無線通信部236、GPS(Global Positioning System)受信部238、電源制御部240、バッテリ242、本体側通信部250、本体マウント260、内蔵フラッシュ30(図1)を構成するフラッシュ発光部270、フラッシュ制御部272、フォーカルプレーンシャッタ(FPS:focal-plane shutter)280、及びFPS制御部296を備える。
 撮像部として機能する撮像素子201は、CMOS(Complementary Metal-Oxide Semiconductor)型のカラーイメージセンサにより構成されている。尚、撮像素子201は、CMOS型に限らず、CCD(Charge Coupled Device)型の撮像素子でもよい。
 撮像素子201は、x方向(水平方向)及びy方向(垂直方向)に二次元的に配列された光電変換素子(フォトダイオード)で構成される複数の画素上に、赤色(R)、緑色(G)及び青色(B)の3原色のカラーフィルタ(Rフィルタ、Gフィルタ、Bフィルタ)のうちのいずれか1色のカラーフィルタが、所定のカラーフィルタ配列にしたがって配置され、RGBの各色の画素が構成される。カラーフィルタ配列は、一般的なベイヤー配列とすることできるが、これに限定されるものではなく、例えば、Trans(登録商標)配列等の他のカラーフィルタ配列でもよい。
 交換レンズ100の撮像光学系102によって撮像素子201の受光面に結像された被写体の光学像は、撮像素子201によって電気信号に変換される。撮像素子201上に形成された各画素には、入射する光量に応じた電荷が蓄積され、撮像素子201からは各画素に蓄積された電荷量(信号電荷)に応じた電気信号が画像信号として読み出される。
 撮像素子制御部202は、本体側CPU220の指令にしたがって撮像素子201から画像信号の読み出し制御を行う。
 また、撮像素子制御部202は、本体側CPU220からのシャッタ制御信号により、撮像素子201をいわゆるグローバルシャッタ方式又はロックリングシャッタ方式で駆動する。
 ここで、グローバルシャッタ方式とは、CMOS型の撮像素子201において、1画面内の全画素に対し一斉にリセットし露光動作を開始する(即ち、1画面内の全画素に対し電荷の蓄積を開始する)方式をいい、ローリングシャッタ方式とは、CMOS型の撮像素子201において、少なくとも1つ以上の走査ラインや画素毎に順次露光動作を行う方式(即ち、走査ラインや画素毎に順次リセットを行い電荷の蓄積を開始し蓄積した電荷を読み出す方式であり、フォーカルプレーンシャッタ方式とも言われる。
 アナログ信号処理部203は、撮像素子201で被写体を撮像して得られたアナログの画像信号に対して、各種のアナログ信号処理を施す。アナログ信号処理部203は、サンプリングホールド回路、色分離回路、AGC(Automatic Gain Control)回路等を含んで構成されている。AGC回路は、撮像時の感度(ISO感度(ISO:International Organization for Standardization))を調整する感度調整部として機能し、入力する画像信号を増幅する増幅器のゲインを調整し、画像信号の信号レベルが適切な範囲に入るようにする。A/D変換器204は、アナログ信号処理部203から出力されたアナログの画像信号をデジタルの画像信号に変換する。
 静止画像又は動画像の撮像時に撮像素子201、アナログ信号処理部203、及びA/D変換器204を介して出力されるRGBの画素毎の画像データ(画素毎にRGBの濃度値を持つRAWデータ)は、画像入力コントローラ205からRAM207に入力され、一時的に記憶される。尚、撮像素子201がCMOS型撮像素子である場合、アナログ信号処理部203及びA/D変換器204は、撮像素子201内に内蔵されていることが多い。
 デジタル信号処理部206は、RAM207に格納されているRAWデータに対して、各種のデジタル信号処理を施す。デジタル信号処理部206は、RAM207に記憶されているRAWデータを適宜読み出し、読み出したRAWデータに対してオフセット処理、RGBのRAWデータを正確な色再現性のある新たなRGB信号に色補正するリニアマトリックス処理、感度補正を含むゲイン・コントロール処理、ガンマ補正処理、デモザイク処理(デモザイキング処理、同時化処理とも言う)、RGB/YCrCb変換処理等のデジタル信号処理を行い、デジタル信号処理後の画像データを再びRAM207に記憶させる。
 尚、デモザイク処理とは、例えば、RGBの3原色のカラーフィルタを有する撮像素子の場合、RGBからなるモザイク画像から画素毎にRGB全ての色情報を算出する処理であり、モザイクデータ(点順次のRGBデータ)から同時化されたRGBの3面の画像データを生成する。また、RGB/YCrCb変換処理は、同時化されたRGBデータを輝度データ(Y)及び色差データ(Cr、Cb)に変換する処理である。
 圧縮伸張処理部208は、静止画像又は動画像の記録時に、一旦RAM207に格納された非圧縮の輝度データY及び色差データCb,Crに対して圧縮処理を施す。静止画像の場合には、例えばJPEG(Joint Photographic coding Experts Group)形式で圧縮し、動画像の場合には、例えばH.264形式で圧縮する。圧縮伸張処理部208により圧縮された画像データは、メディア制御部210を介してメモリカード212に記録される。また、圧縮伸張処理部208は、再生モード時にメディア制御部210を介してメモリカード212から得た圧縮された画像データに対して伸張処理を施し、非圧縮の画像データを生成する。
 メディア制御部210は、圧縮伸張処理部208で圧縮された画像データを、メモリカード212に記録する制御を行う。また、メディア制御部210は、メモリカード212から、圧縮された画像データを読み出す制御を行う。
 表示制御部214は、RAM207に格納されている非圧縮の画像データを、液晶モニタ216に表示させる制御を行う。液晶モニタ216は、液晶表示デバイスにより構成されているが、液晶モニタ216の代わりに有機エレクトロルミネッセンスなどの表示デバイスによって構成してもよい。
 液晶モニタ216にライブビュー画像を表示させる場合には、デジタル信号処理部206で連続的に生成されたデジタルの画像信号が、RAM207に一時的に記憶される。表示制御部214は、このRAM207に一時記憶されたデジタルの画像信号を表示用の信号形式に変換して、液晶モニタ216に順次出力する。これにより、液晶モニタ216に撮像画像がリアルタイムに表示され、液晶モニタ216を電子ビューファインダとして使用することができる。
 シャッタレリーズスイッチ22は、静止画像や動画像の撮像指示を入力するための撮像指示部であり、いわゆる「半押し」と「全押し」とからなる2段ストローク式のスイッチで構成されている。
 静止画像撮像モードの場合、シャッタレリーズスイッチ22が半押しされることによってS1オンの信号、半押しから更に押し込む全押しがされることによってS2オンの信号が出力され、S1オン信号が出力されると、本体側CPU220は、AF制御(自動焦点調節)及びAE制御(自動露出制御)などの撮影準備処理を実行し、S2オン信号が出力されると、静止画像の撮像処理及び記録処理を実行する。
 尚、AF制御及びAE制御は、それぞれ操作部222によりオートモードが設定されている場合に自動的に行われ、マニュアルモードが設定されている場合には、AF制御及びAE制御が行われないことは言うまでもない。
 また、動画像撮像モードの場合、シャッタレリーズスイッチ22が全押しされることによってS2オンの信号が出力されると、カメラ本体200は、動画像の記録を開始する動画像記録モードになり、動画像の画像処理及び記録処理を実行し、その後、シャッタレリーズスイッチ22が再び全押しされることによってS2オンの信号が出力されると、カメラ本体200は、スタンバイ状態になり、動画像の記録処理を一時停止する。
 尚、シャッタレリーズスイッチ22は半押しと全押しとからなる2段ストローク式のスイッチの形態に限られず、1回の操作でS1オンの信号、S2オンの信号を出力しても良く、それぞれ個別のスイッチを設けてS1オンの信号、S2オンの信号を出力しても良い。
 また、タッチパネル等により操作指示を行う形態では、これら操作手段としてタッチパネルの画面に表示される操作指示に対応する領域をタッチすることで操作指示を出力するようにしても良く、撮影準備処理や撮像処理を指示するものであれば操作手段の形態はこれらに限られない。
 撮像により取得された静止画像又は動画像は、圧縮伸張処理部208により圧縮され、圧縮された画像データは、撮像日時、GPS情報、撮像条件(F値、シャッタスピード、ISO感度等)の所要の付属情報が、ヘッダに付加された画像ファイルとされた後、メディア制御部210を介してメモリカード212に記録される。
 本体側CPU220は、カメラ本体200全体の動作及び交換レンズ100の光学部材の駆動等を統括制御するもので、シャッタレリーズスイッチ22を含む操作部222等からの入力に基づき、カメラ本体200の各部及び交換レンズ100を制御する。
 フラッシュROM226は、読み取り及び書き込みが可能な不揮発性メモリであり、設定情報を記憶する。
 ROM228には、本体側CPU220が実行するカメラ制御プログラム、本発明に係る画像処理プログラム、撮像素子201の欠陥情報、画像処理等に使用する各種のパラメータやテーブルが記憶されている。本体側CPU220は、ROM228に格納されたカメラ制御プログラムにしたがい、RAM207を作業領域としながらカメラ本体200の各部、及び交換レンズ100を制御する。
 AF検出部230は、デジタルの画像信号に基づいて、AF制御に必要な数値を算出する。いわゆるコントラストAFの場合、例えば所定のAFエリア内におけるG信号の高周波成分の積算値(焦点評価値)を算出する。本体側CPU220は、AF制御時に焦点評価値が最大となる位置(即ち、コントラストが最大になる位置)に交換レンズ100のレンズ群104に含まれるフォーカスレンズを移動させる。尚、AFは、コントラストAFには限定されず、例えば、撮像素子に設けられた位相差検出用画素の画素データに基づいてデフォーカス量を検出し、このデフォーカス量がゼロになるようにフォーカスレンズを移動させる位相差AFを行うものでもよい。
 AE制御部232は、被写体の明るさ(被写体輝度)を検出する部分であり、被写体輝度に対応するAE制御及びAWB(Auto White Balance)制御に必要な数値(露出値(EV値(exposure value)))を算出する。AE制御部232は、撮像素子201を介して取得した画像の輝度、画像の輝度の取得時のシャッタスピード及びF値によりEV値を算出する。
 本体側CPU220は、AE制御部232から得たEV値に基づいて所定のプログラム線図からF値、シャッタスピード及びISO感度を決定し、AE制御を行うことができる。
 ホワイトバランス補正部234は、RGBデータ(Rデータ、Gデータ及びBデータ)の色データ毎のホワイトバランスゲイン(WB(White Balance)ゲイン)Gr,Gg,Gbを算出し、Rデータ、Gデータ及びBデータに、それぞれ算出したWBゲインGr,Gg,Gbを乗算することによりホワイトバランス補正を行う。ここで、WBゲインGr,Gg,Gbの算出方法としては、被写体の明るさ(EV値)によるシーン認識(室外、室内の判定等)及び周囲光の色温度等に基づいて被写体を照明している光源種を特定し、予め光源種毎に適切なWBゲインが記憶されている記憶部から特定した光源種に対応するWBゲインを読み出す方法が考えられるが、少なくともEV値を使用してWBゲインGr,Gg,Gbを求める他の公知の方法が考えられる。
 無線通信部236は、Wi-Fi(Wireless Fidelity)(登録商標)、Bluetooth(登録商標)等の規格の近距離無線通信を行う部分であり、周辺のデジタル機器(スマートフォン、等の携帯端末)との間で必要な情報の送受信を行う。
 GPS受信部238は、本体側CPU220の指示にしたがって、複数のGPS衛星から送信されるGPS信号を受信し、受信した複数のGPS信号に基づく測位演算処理を実行し、カメラ本体200の緯度、経度、及び高度からなるGPS情報を取得する。取得されたGPS情報は、撮像された画像の撮像位置を示す付属情報として画像ファイルのヘッダに記録することができる。
 電源制御部240は、本体側CPU220の指令にしたがって、バッテリ242から供給される電源電圧をカメラ本体200の各部に与える。また、電源制御部240は、本体側CPU220の指令にしたがって、本体マウント248及びレンズマウント160を介して、バッテリ242から供給される電源電圧を交換レンズ100の各部に与える。
 レンズ電源スイッチ244は、本体側CPU220の指令にしたがって、本体マウント248及びレンズマウント160を介して交換レンズ100に与える電源電圧のオン及びオフの切り替えとレベルの切り替えを行う。
 本体側通信部246は、本体側CPU220の指令にしたがって、本体マウント248及びレンズマウント160を介して接続された交換レンズ100のレンズ側通信部150との間で、リクエスト信号、回答信号の送受信(双方向通信)を行う。尚、本体マウント260には、図1に示すように複数の端子260Aが設けられており、交換レンズ100がカメラ本体200に装着(レンズマウント160と本体マウント260とが接続)されると、本体マウント260に設けられた複数の端子260A(図1)と、レンズマウント160に設けられた複数の端子(図示せず)とが電気的に接続され、本体側通信部250とレンズ側通信部150との間で双方向通信が可能になる。
 内蔵フラッシュ30(図1)は、例えば、TTL(Through The Lens)自動調光方式のフラッシュであり、フラッシュ発光部270と、フラッシュ制御部272とから構成されている。
 フラッシュ制御部272は、フラッシュ発光部270から発光するフラッシュ光の発光量(ガイドナンバー)を調整する機能を有する。即ち、フラッシュ制御部272は、本体側CPU220からのフラッシュ撮像指示に同期してフラッシュ発光部270を発光させ、交換レンズ100の撮像光学系102を介して入射する反射光(周囲光を含む)の測光を開始し、測光値が標準露出値に達すると、フラッシュ発光部270からのフラッシュ光の発光を停止させる。
 フォーカルプレーンシャッタ280は、撮像装置10のメカシャッタを構成し、撮像素子201の直前に配置される。
 FPS制御部296は、本体側CPU220からの指示入力に基づいてFPS駆動部(図示しないチャージモータ、先幕用電磁石及び後幕用電磁石)に制御信号を出力する部分である。
 チャージモータによりフォーカルプレーンシャッタ280の先幕及び後幕がチャージ位置に駆動され、先幕用電磁石及び後幕用電磁石により固定されている状態で、シャッタレリーズスイッチ22がONされると、FPS制御部296は、先幕をチャージ位置で保持している先幕用電磁石をOFFにし、先幕走行用バネにより先幕を開方向に走行させ、露光用開口部を開く。その後、FPS制御部296は、シャッタスピードに対応する時間の経過後に後幕をチャージ位置で保持している後幕用電磁石をOFFにし、後幕走行用バネにより後幕を閉方向に走行させ、露光用開口部を閉じる。これにより、シャッタスピードに対応する時間だけ撮像素子201を露光させる。
 [画像処理装置の第1実施形態]
 カメラ本体200には、本発明に係る画像処理装置が設けられている。
 本発明に係る画像処理装置は、デジタル信号処理部206、又はデジタル信号処理部206及び本体側CPU220に設けられ、あるいは図示しない専用のハードウェアとして設けられる。
 図4は、本発明に係る画像処理装置の第1実施形態を示すブロック図である。
 図4に示す画像処理装置は、動画像撮像モード(特に静止画像抽出用の第2動画像撮像モード)による動画像を撮像する場合に、光源の変化に伴って動画像のフレーム間で異なる色補正を行う装置であり、主として動画像取得部302、フレーム特定部310、第1画像領域決定部320、第1色信号取得部330、第1補正係数算出部340、及び第1色補正部350から構成されている。
 尚、本例の動画像撮像モードは、撮像素子201の走査ライン毎に順次リセットを行い、走査ライン毎に順次露光動作(電荷の蓄積開始)を行い、露光時間経過後に走査ライン毎に順次蓄積した電荷に対応するデータを読み出すロックリングシャッタ方式による動画像の撮像を行うものとする。
 動画像取得部302は、第2動画像撮像モードが設定され、交換レンズ100及び撮像素子201等により撮像された動画像データを取得する部分であり、本例では動画像データとしてRAM207に一時記憶されたRAWデータ300を取得する。動画像取得部302により取得されたRAWデータ300は、第1色補正部350及びフレーム特定部310に出力される。
 フレーム特定部310は、動画像取得部302が取得した動画像を構成する複数のフレームより基準フレームと、その基準フレームに対する補正フレームとを特定する。本例のフレーム特定部310は、フリッカ位相検出部312を有し、フリッカ位相検出部312は、光源のフリッカ位相を検出する。
 室内の光源下で動画像の撮像を行う場合、蛍光灯、LED(light emitting diode)等の人工光源は、商用電源の周波数(50Hz又は60Hz)の影響を受け、商用電源の周波数に対応する周波数のフリッカを発生する。
 したがって、人工光源下で動画像の撮像を行うと、人工光源のフリッカにより動画像のフレーム間で色味が変化し、特にフレーム間隔よりも1フレーム当りの露光時間が短い(フリッカ周期よりも短い)第2動画像撮像モードでは、フレーム間での色味の変化が顕著である。
 フリッカ位相検出部312は、動画像取得部302が取得した1フレーム分のRAWデータ300の各走査ラインの明暗の変化等により光源のフリッカ周波数、フリッカ位相を検出する。フリッカ位相は、例えば、各フレームの1ライン目の露光開始時点を基準にし、その露光開始時点から光源の輝度が最大になる時間として検出することができる。
 いま、光源のフリッカ周波数と動画像のフレームレート(fps:frames per second)とが一致している場合、フレーム間ではフリッカの影響はないが、不一致の場合、フレーム間で色味が変化する。
 光源のフリッカ周波数と動画像のフレームレートとが異なる場合でも、一定の周期毎に同一のフリッカ位相又はほぼ同一のフリッカ位相が現われる。
 フレーム特定部310は、フリッカ位相検出部312により検出されるフリッカ位相に基づいて、一定の周期毎に現われる特定のフリッカ位相のフレームを基準フレームとし、他のフレームを補正フレームとして決定する。一定の周期毎の基準フレームは、一定の周期内で最も明るいフレームが好ましい。
 第1画像領域決定部320は、フレーム特定部310により特定された基準フレームと補正フレームとから、それぞれフレーム内の第1補正係数の算出に用いる画像領域を決定する部分であり、基準フレームと補正フレームの各演算領域内における基準フレームより第1基準画像領域を決定し、補正フレームより第1基準画像領域に対応する第1補正画像領域を決定する。
 基準フレーム及び補正フレームの各演算領域は、フレームの全領域でもよいし、フレームのフォーカス領域、あるいはフレームの中央領域でもよい。
 第1基準画像領域は、例えば、基準フレームの演算領域内の予め設定された複数の画素位置における特定画素又は特定画素を含む周辺画素の画像領域とすることができる。尚、本例では、特定位置の1画素の領域も第1基準画像領域を構成する領域とすることができる。
 第1補正画像領域は、補正フレームの演算領域内の領域であり、第1基準画像領域に対応する領域である。本例の第1基準画像領域と第1補正画像領域とは、撮像素子201の露光開始と露光終了のタイミングが同じ走査ライン上の画像領域であり、それぞれ同じ位置の領域である。
 第1色信号取得部330は、第1画像領域決定部320により決定された第1基準画像領域の色画像データ(本例では、RGBのRAWデータ)より、RAWデータの第1基準画像領域のR画素の画素データの代表値、G画素の画素データの代表値、及びB画素の画素データの代表値を、複数の第1基準画像領域毎に第1基準色信号(Rref、Gref、Bref)として取得する。
 ここで、第1基準画像領域におけるRAWデータが、R画素、G画素、B画素のうちのいずれか1つの場合、その画素の画素データが代表値である。また、第1基準画像領域にR画素が複数存在する場合には、複数のR画素の画素データの平均値、又は複数のR画素の画素データを、第1基準画像領域の中心からの距離に応じて重み付け平均した値を代表値とすることができる。第1基準画像領域にG画素、B画素がそれぞれ複数存在する場合もG画素、B画素の代表値も上記と同様にして求めることができる。
 第1色信号取得部330は、同様にして第1画像領域決定部320により決定された第1補正画像領域のRGBのRAWデータより、RAWデータの第1補正画像領域のR画素の画素データの代表値、G画素の画素データの代表値、及びB画素の画素データの代表値を、複数の第1補正画像領域毎に第1補正色信号(R、G、B)として取得する。
 第1補正係数算出部340は、第1補正色信号(R、G、B)を、第1基準色信号(Rref、Gref、Bref)に合わせる第1補正係数を算出する。
 具体的には、第1補正係数算出部340は、複数の画像領域(第1基準画像領域と第1補正画像領域の複数ペアの画像領域)において、次式
 [数1]
 Rref=α1・R+β1・G+γ1・B+Δ1
 [数2]
 Gref=α2・R+β2・G+γ2・B+Δ2
 [数3]
 Bref=α3・R+β3・G+γ3・B+Δ3
を成立させる第1補正係数であるα1、α2、α3、β1、β2、β3、γ1、γ2、γ3、Δ1、Δ2、Δ3を算出する。
 第1補正係数算出部340は、[数1]式から[数3]式を成立させる第1補正係数(α1、α2、α3、β1、β2、β3、γ1、γ2、γ3、Δ1、Δ2、Δ3)を算出する場合に、複数の画像領域において、最小自乗法によりRrefとR、GrefとG、及びBrefとBの差がそれぞれ最小になるα1、α2、α3、β1、β2、β3、γ1、γ2、γ3、Δ1、Δ2、Δ3を算出する。
 [数1]式から[数3]式に示す第1補正係数(α1、α2、α3、β1、β2、β3、γ1、γ2、γ3)は、補正フレームのRGBのRAWデータに対する乗数であり、第1補正係数(Δ1、Δ2、Δ3)は、補正フレームのRGBのRAWデータのオフセット値である。
 オフセット値は、補正フレームの露光時間における光源が、単色光などスペクトルに偏りがある場合、あるいは基準フレームの露光時間における光源には、RGBの全ての波長帯域が含まれるが、補正フレームの露光時間における光源には、RGBの波長帯域のうちのいずれか1以上の波長帯域が不足する場合に、後述する色補正において、補正フレームの色の再現性を上げるために必要な補正係数である。したがって、光源の波長帯域によっては、第1補正係数(Δ1、Δ2、Δ3)はゼロにし、またはオフセット用の第1補正係数(Δ1、Δ2、Δ3)は設けないようにしてもよい。
 第1色補正部350は、第1補正係数算出部340により算出された第1補正係数(α1、α2、α3、β1、β2、β3、γ1、γ2、γ3、Δ1、Δ2、Δ3)を補正フレームに適用し、補正フレームの色補正を行う。
 即ち、第1色補正部350は、動画像取得部302から入力するRAWデータ300のフレームが補正フレームであって、その補正フレームのRAWデータのR画素の画素データを補正する場合、[数1]式に示したようにR画素の画素データ(R)と、R画素の周辺のG画素の画素データ(G)と、R画素の周辺のB画素の画素データ(B)にそれぞれ第1補正係数(α1、β1、γ1)を乗算するとともに、オフセット値Δ1を加算して、色補正したR画素の画素データを取得する。
 第1色補正部350は、補正フレームのRAWデータのG画素の画素データを補正する場合、[数2]式に示したようにG画素の周辺のR画素の画素データ(R)と、G画素の画素データ(G)と、G画素の周辺のB画素の画素データ(B)にそれぞれ第1補正係数(α2、β2、γ2)を乗算するとともに、オフセット値Δ2を加算して、色補正したG画素の画素データを取得し、補正フレームのRAWデータのB画素の画素データを補正する場合、[数3]式に示したようにB画素の周辺のR画素の画素データ(R)と、B画素の周辺のG画素の画素データ(G)と、B画素の画素データ(B)にそれぞれ第1補正係数(α3、β3、γ3)を乗算するとともに、オフセット値Δ3を加算して、色補正したG画素の画素データを取得する。
 上記構成の画像処理装置によれば、補正フレームのRAWデータの色味を基準フレームの色味に合わせ、又は近づけることができる。
 また、この画像処理装置は、Rデータ、Gデータ及びBデータに、光源種や色温度等に応じたWBゲインGr,Gg,Gbを乗算することにより、ホワイトバランス補正を行うホワイトバランス補正部234とは異なり、光源種や色温度等に依存しない画像処理であり、光源のフリッカに関わらず補正フレームの色味を基準フレームの色味に合わせることができる。
 尚、デジタル信号処理部206のリニアマトリックス処理部は、RGBの色画像データに対して3×3の固定係数による行列演算を行うが、この固定係数に第1補正係数(α1、α2、α3、β1、β2、β3、γ1、γ2、γ3)を乗算した値を適用することができる。また、デジタル信号処理部206のオフセット処理部は、撮像素子201のオプティカルブラック領域に発生する信号成分(オフセット値)を減算することで暗電流の影響を補正する部分であるが、オフセット処理部のオフセット値に第1補正係数(Δ1、Δ2、Δ3)を加算した値を適用することができる。これにより、リニアマトリックス処理部及びオフセット処理部を第1色補正部350として機能させることができる。
 図5は、画像処理装置のハードウェア構成の一例を示す積層型CMOSの実施形態を示す図である。尚、図5において、図4に示した画像処理装置と共通する部分には同一の符号を付し、その詳細な説明は省略する。
 図5において、基準フレーム記憶領域314に基準フレーム、補正フレーム記憶領域316に補正フレームの画素データを一時記憶させる。基準フレーム記憶領域314及び補正フレーム記憶領域316からは、第1補正係数の演算に使用する第1画像領域322毎に、それぞれ第1基準画像領域の画素データ(第1基準色信号(Rref、Gref、Bref))及び第1補正画像領域の画素データ(第1補正色信号(R、G、B))が並列に読み出され、第1補正係数算出部340に加えられる。
 第1補正係数算出部340は、並列に読み出された同一の第1画像領域である第1基準画像領域の第1基準色信号(Rref、Gref、Bref)と、第1補正画像領域の第1補正色信号(R、G、B)とに基づいて、第1補正画像領域の第1補正色信号を、第1基準画像領域の第1基準色信号に合わせる第1補正係数を算出する。
 第1色補正部350は、補正フレーム記憶領域316から読み出される補正フレームの画素データに対して第1補正係数算出部340により算出された第1補正係数を使用した補正処理を行い出力する。
 このようにして基準フレームと補正フレームの対応する第1画像領域毎の演算を並列に行うことで第1補正係数の算出時間を短縮し、補正フレームの色補正をリアルタイムで実行可能にしている。
 [画像処理装置の第2実施形態]
 図6は、本発明に係る画像処理装置の第2実施形態を示すブロック図である。
 図6に示すフレーム特定部311は、第1実施形態のように光源のフリッカ位相に対応して基準フレームと補正フレームとを特定するものではなく、例えば、動画像撮像時の最初のフレームを基準フレームとして特定し、それ以降のフレームを補正フレームとして特定し、あるいは操作部222を使用してユーザが指定したフレームを基準フレームとして特定し、それ以外のフレームを補正フレームとして特定することができる。基準フレームと補正フレームの特定方法はこれに限定されず、例えば、人物等の主要被写体が最初に検出されたフレームを基準フレームとし、それ以降のフレームであって、主要被写体が撮像されているフレームを補正フレームとすることができる。
 第1画像領域決定部321は、オブジェクト検出部324を有し、オブジェクト検出部324により検出されたフレーム内のオブジェクトに対応する演算領域を決定する。オブジェクト検出部324は、画像の特徴量を抽出し、抽出した特徴量に基づいてフレーム内の人物、建物、空、地面などの1以上のオブジェクトを検出するもので、オブジェクト検出用に機械学習させた学習器などを使用することができる。
 第1画像領域決定部321は、オブジェクト検出部324により検出されたフレーム内のオブジェクトを基準にして演算領域を決定する。複数のオブジェクトが検出された場合には、画面中心に近いオブジェクト、あるいは優先順位の高いオブジェクトを選択することができる。
 図7は室外で撮像された動画像の基準フレームFrefと屋内で撮像された動画像の補正フレームFの一例を示す図である。
 図7に示す例では、基準フレームFref及び補正フレームF内のオブジェクトとして人物が検出されており、第1画像領域決定部321は、検出された人物を基準にして基準フレームFrefにおける演算領域A、及び補正フレームFにおける演算領域Cを決定することができる。
 第1画像領域決定部321は、基準フレームFrefの演算領域A内のn個の第1基準画像領域B1~Bnを決定し、補正フレームFの演算領域C内のn個の第1補正画像領域D1~Dnを決定する。尚、図7に示す例では、第1基準画像領域B1~Bnと第1補正画像領域D1~Dnとはそれぞれ同じ位置の領域である。また、図7では、それぞれ1つの第1基準画像領域B1及び第1補正画像領域D1のみが図示されている。
 図6に戻って、第1色信号取得部330は、第1画像領域決定部321により決定された第1基準画像領域B1~Bnの色画像データより第1基準画像領域B1~Bn毎に第1基準色信号(Rref、Gref、Bref)を取得し、同様に第1画像領域決定部321により決定された第1補正画像領域D1~Dnの色画像データより第1補正画像領域D1~Dn毎に第1補正色信号(R、G、B)を取得する。
 第1補正係数算出部340は、複数ペアの第1基準色信号(Rref、Gref、Bref)と第1補正色信号(R、G、B)に基づいて、第1補正色信号(R、G、B)を、第1基準色信号(Rref、Gref、Bref)に合わせるための第1補正係数([数1]式~[数3]式のα1~α3、β1~β3、γ1~γ3、Δ1~Δ3)を算出する。
 第1色補正部350は、第1補正係数算出部340により算出された第1補正係数(α1、α2、α3、β1、β2、β3、γ1、γ2、γ3、Δ1、Δ2、Δ3)を補正フレームに適用し、補正フレームの色補正を行う。
 室外の自然光から室内の単色照明に光源が切り替わる場合、これらの光源に応じたWBゲインGr,Gg,Gbを、Rデータ、Gデータ及びBデータに乗算するホワイトバランス補正を行っても被写体の色味は大きく異なるが、第2実施形態によれば、室内で撮像される動画像(演算領域Cの被写体)を、室外で撮像された演算領域Aの被写体の色味に近づけることができる。
 尚、補正フレームFの演算領域C以外の背景領域の色味は、基準フレームFrefの演算領域A以外の背景領域の色味に必ずしも近づかないが、少なくとも補正フレームFの被写体(主要被写体)を含む演算領域Cの色味を、基準フレームFrefの演算領域Aの色味に近づけることができる。
 図8は事前に準備した基準フレームFrefと補正フレームFの一例を示す図である。
 図8に示す基準フレームFrefは、色味を合わせたいオブジェクト画像として顔画像を含み、この顔画像を含む顔領域を演算領域Aとしている。
 オブジェクト検出部324(図6)は補正フレームFから顔画像を検出し、第1画像領域決定部321は、オブジェクト検出部324により検出された顔画像を含む顔領域を演算領域Cとする。
 図8に示すように基準フレームFrefの演算領域Aと補正フレームFの演算領域Cの位置及び大きさが異なる場合、オブジェクト検出部324は、基準フレームFrefの演算領域Aに含まれる顔領域から顔パーツ(例えば、目、鼻、口、頬、額、顎、眉毛、頭髪等)を検出し、同様に補正フレームFの演算領域Cに含まれる顔領域から顔パーツを検出する。
 第1画像領域決定部321は、オブジェクト検出部324により検出された基準フレームFrefの演算領域Aに含まれる各顔パーツの領域を第1基準画像領域とし、補正フレームFの演算領域Cに含まれる各顔パーツの領域を第1補正画像領域とすることができる。
 このようにして第1補正係数を算出するための第1基準画像領域及び第1補正画像領域を決定することで、事前に決めた特定の被写体の好ましい色味に、補正フレーム内の特定の被写体の色味を近づけることができる。
 [画像処理装置の第3実施形態]
 図9は、光源のフリッカと撮像素子の露光動作と動画像データとの関係を模式的に示した図である。
 図9に示す光源は、商用電源の周波数に応じて明滅を繰り返す。また、撮像素子201は、動画像を撮像する場合にローリングシャッタ方式で駆動されており、1フレームの走査ライン毎に露光開始のタイミングがずれている。
 したがって、光源のフリッカにより、同一フレーム内であっても走査ラインの位置に応じて露光時間中の光源からの入射光量やRGBの分光比が異なり、同一フレーム内でも色味が走査ラインに応じて変化する。
 図10は、本発明に係る画像処理装置の第3実施形態を示すブロック図である。
 図10に示す第3実施形態の画像処理装置は、同一フレーム内の色味の変化を補正するものであり、主として動画像取得部303、ライン画像特定部410、第2画像領域決定部420、第2色信号取得部430、第2補正係数算出部440、及び第2色補正部450から構成されている。
 RAWデータ301は、図9に示したようにフリッカを有する光源下で、ローリングシャッタ方式で撮像素子201が駆動される場合に、撮像素子201から得られる動画像データである。動画像取得部303はRAWデータ301を取得し、取得したRAWデータ301をライン画像特定部410及び第2色補正部450に出力する。
 ライン画像特定部410は、RAWデータ301の各フレームにおいて、基準走査ライン上の画像を基準ライン画像として特定し、基準走査ライン画像に隣接する走査ライン上の画像を補正ライン画像として特定する。
 各フレームの最初の基準走査ラインは、例えば、1フレーム内の先頭の走査ラインとすることができる。また、各フレームの最初の基準走査ラインは、フリッカの影響が少ない走査ラインとすることができる。フリッカの影響が少ない走査ラインとは、走査ラインの露光時間における光源の輝度変化が少ない走査ラインである。
 また、ライン画像特定部410は、後述の第2色補正部450により色補正された補正ライン画像を、隣接する次の補正ライン画像に対する基準ライン画像として特定する。
 第2画像領域決定部420は、ライン画像特定部410により特定された基準ライン画像と補正ライン画像とから、それぞれライン画像内の第2補正係数の算出に用いる画像領域を決定する部分であり、基準ライン画像と補正ライン画像の各演算領域内における基準ライン画像より第2基準画像領域を決定し、補正ライン画像より第2基準画像領域に対応する第2補正画像領域を決定する。
 本例の第2基準画像領域と第2補正画像領域とは、それぞれライン画像内の同じ位置の領域とすることができる。
 第2基準画像領域は、例えば、基準ライン画像の演算領域内の予め設定された複数の画素位置における特定画素又は特定画素を含む周辺画素の画像領域とすることができる。特定画素は、ライン画像の全領域の画素が含まれるように複数選択することが望ましい。
 第2補正画像領域は、補正ライン画像の演算領域内の領域であり、第2基準画像領域に対応する領域である。
 本例の基準ライン画像と補正ライン画像とは、互いに隣接する走査ライン上のライン画像であり、露光時間が近似し、かつ被写体の相関が高いため、色の変化を抽出し易い。
 第2色信号取得部430は、第2画像領域決定部420により決定された第2基準画像領域の色画像データ(本例では、RGBのRAWデータ)より、RAWデータの第2基準画像領域のR画素の画素データの代表値、G画素の画素データの代表値、及びB画素の画素データの代表値を、複数の第2基準画像領域毎に第2基準色信号(Rref、Gref、Bref)として取得する。
 第2色信号取得部430は、同様にして第2画像領域決定部420により決定された第2補正画像領域のRGBのRAWデータより、RAWデータの第2補正画像領域のR画素の画素データの代表値、G画素の画素データの代表値、及びB画素の画素データの代表値を、複数の第2補正画像領域毎に第2補正色信号(R、G、B)として取得する。
 尚、比較する第2基準色信号と第2補正色信号のペアを多くすることが望ましい。演算に使用する第2基準色信号と第2補正色信号のペアを多くすることで、局所的なライン間の被写体の相関性の低さに起因する、第2補正係数の誤差を減らすためである。
 第2補正係数算出部440は、第2補正色信号(R、G、B)を、第2基準色信号(Rref、Gref、Bref)に合わせる第2補正係数を算出する。尚、第2補正係数の演算は、フレーム間の第1補正係数の演算と同様に行うことができる。
 第2色補正部450は、第2補正係数算出部440により算出された第2補正係数(α1~α3、β1~β3、γ1~γ3、Δ1~Δ3)を補正ライン画像に適用し、補正ライン画像の色補正を行う。尚、第2補正係数のうちのオフセット値(Δ1~Δ3)は省略することができる。
 第2色補正部450は、動画像取得部303から入力するRAWデータ300の1ライン毎の補正ライン画像に、ライン毎に算出された第2補正係数を適用して色補正し、色補正した補正ライン画像を出力する。ライン画像特定部410は、第2色補正部450により色補正された補正ライン画像を、次の補正ライン画像に対する基準ライン画像として取得する。
 このようにして補正ライン画像を順次色補正することにより、同一フレーム内の色味の変化(色ムラ、輝度ムラ)を補正することができる。
 図11は、本発明に係る画像処理装置の第4実施形態を示すブロック図である。尚、図11において、図10に示した第3実施形態の画像処理装置と共通する部分には同一の符号を付し、その詳細な説明は省略する。
 図11に示す第4実施形態の画像処理装置は、第3実施形態と同様に同一フレーム内の色味の変化を補正するものであるが、主としてライン画像特定部411による基準ライン画像と補正ライン画像の特定方法、及び第2画像領域決定部421による比較する画像領域の決定方法が異なる。
 ライン画像特定部411は、動画像データを構成する各フレームにおいて、基準走査ライン上のライン画像を基準ライン画像として特定し、基準走査ライン以外の走査ライン上のライン画像を補正ライン画像として特定する。ここで、基準走査ラインは、フリッカの影響が少ない走査ラインとすることができる。
 第2画像領域決定部421は、ライン画像特定部411により特定された基準ライン画像と補正ライン画像とから、それぞれライン画像内の第2補正係数の算出に用いる画像領域を決定する部分であり、基準ライン画像と補正ライン画像の各演算領域内における基準ライン画像より第2基準画像領域を決定し、補正ライン画像毎に第2基準画像領域に対応する第2補正画像領域を決定する。
 ここで、基準ライン画像と補正ライン画像は、フレーム内で離れていることが想定されるため、第2画像領域決定部421は、基準ライン画像と補正ライン画像から色が似通った走査ライン方向(水平方向)の画素同士を含む複数の画像領域を決定する。色が似通っているかどうかの判断は、例えば、画素データ(R、G、B)から、(R-G)/(B-G)を算出し、その算出結果の差が基準値以下になるか否かにより行うことができる。尚、本例では、RAWデータを入力データとするため、例えば、比較する特定画素がR画素の画素データの場合、そのR画素の近傍のG画素、B画素の画素データを使用して、色が似通っているか否かの判断を行う。
 また、第2画像領域決定部421は、フレームから顔画像等のオブジェクトを検出するオブジェクト検出部424を備えている。第2画像領域決定部421は、オブジェクト検出部424により検出された、基準ライン画像の第2基準画像領域に含まれるオブジェクトと同じオブジェクトを含み、かつ色が似通った画素を含む補正ライン画像の画像領域を第2補正画像領域として決定することが望ましい。
 第4実施形態によれば、フレーム内で基準ライン画像と補正ライン画像が離れていても、色補正に使用する特定画素を決定することができる。
 フリッカを有する光源下で、ローリングシャッタ方式で撮像素子を駆動して取得した動画像データの場合、第1実施形態又は第2実施形態の画像処理装置によりフレーム間の色味の変化を補正するとともに、第3実施形態又は第4実施形態の画像処理装置により同一フレーム内の色味の変化を補正することが望ましい。この場合、最初に同一フレーム内の色味の変化を補正し、その後、フレーム間の色味の変化を補正することが望ましい。
 また、本例では、補正対象の動画像データとしてRAWデータを使用する場合について説明したが、これに限らず、例えば、リニアマトリックス処理後の動画像データ、デモザイク処理後の同時化されたRGBデータ、RGB/YCrCb変換処理により同時化されたRGBデータを輝度データ(Y)及び色差データ(Cr、Cb)に変換したYCrCbデータを、補正対象の動画像データとしてもよい。
 尚、YCrCbデータを、補正対象の動画像データとする場合、[数1]式から[数3]式において、RGBデータの代わりにYCrCbデータが適用されることは言うまでもない。また、撮像素子は、RGBのカラーフィルタを備えているものに限らず、イエロー、エメラルドなどの他の色を含むものでもよい。
 [画像処理方法]
 図12は、本発明に係る画像処理方法の実施形態を示すフローチャートである。尚、図12に示す画像処理方法は、図4に示した第1実施形態の画像処理装置に対応するものである。
 図12において、本体側CPU220は、静止画像抽出用の動画像を撮像する第2動画像撮像モードが設定され、動画像撮像のスタンバイ中にシャッタレリーズスイッチ22から動画像の撮像開始の指示入力があるか否かを判別する(ステップS10)。本体側CPU220は、動画像の撮像開始の指示入力を受け付けると、撮像素子制御部202を介して撮像素子201を駆動し、静止画像抽出用の動画像の撮像を行わせ、撮像された動画像データであるRAWデータに対して、画像処理装置として機能するデジタル信号処理部206により画像処理を行わせる。
 図4に示した画像処理装置の動画像取得部302は、1フレーム分のRAWデータ300を取得する(ステップS12)。フレーム特定部310は、動画像取得部302により取得された1フレームが、動画像を構成する複数のフレームのうちの基準フレームであるか補正フレームであるかを特定し、特定した基準フレーム又は補正フレームを取得する(ステップS14)。基準フレーム又は補正フレームの特定は、フリッカ位相検出部312により検出されるフリッカ位相に基づいて行うことができる。
 第1画像領域決定部320は、フレーム特定部310により特定された基準フレームから第1補正係数の算出に用いる複数の第1基準画像領域を決定し、フレーム特定部310により特定された補正フレームから複数の第1基準画像領域にそれぞれ対応する複数の第1補正画像領域を決定する(ステップS16)。
 第1色信号取得部330は、第1画像領域決定部320により決定された複数の第1基準画像領域のRAWデータより、第1基準画像領域毎に第1基準色信号(Rref、Gref、Bref)を取得し、複数の第1補正画像領域のRAWデータより、第1補正画像領域毎に第1補正色信号(R、G、B)を取得する(ステップS18)。
 第1補正係数算出部340は、第1色信号取得部330により取得された複数ペアの第1基準色信号(Rref、Gref、Bref)と第1補正色信号(R、G、B)に基づいて、第1補正色信号(R、G、B)を、第1基準色信号(Rref、Gref、Bref)に合わせるための第1補正係数([数1]式~[数3]式のα1~α3、β1~β3、γ1~γ3、Δ1~Δ3)を算出する(ステップS20)。
 第1色補正部350は、動画像取得部302から入力する補正フレームに対して第1補正係数算出部340により算出された第1補正係数を適用し、補正フレームの色補正を行う(ステップS22)。この補正フレームに対する色補正により、補正フレームの色味を基準フレームの色味に近づけることができる。
 続いて、本体側CPU220は、シャッタレリーズスイッチ22から動画像の撮像終了の指示入力があるか否かを判別する(ステップS24)。本体側CPU220は、動画像の撮像終了の指示入力がない場合には、ステップS12に遷移させる。これにより、次のフレームに対してステップS12からステップS24の処理を実行させる。一方、動画像の撮像終了の指示入力を受け付けると、第2動画像撮像モードによる動画像の撮像及び画像処理等を終了させる。
 尚、上記実施形態の画像処理方法では、動画像の撮像により取得したRAWデータをリアルタイムに補正処理しているが、例えば、RAWデータを一旦、記憶媒体(メモリカード212やフラッシュROM226)に一旦記録した後、記憶媒体からRAWデータを読み出して補正処理を行うようにしてもよい。
 本実施形態の撮像装置10は、ミラーレスのデジタル一眼カメラであるが、これに限らず、一眼レフカメラ、レンズ一体型の撮像装置、デジタルビデオカメラ等でもよく、また、撮像機能に加えて撮像以外の他の機能(通話機能、通信機能、その他のコンピュータ機能)を備えるモバイル機器に対しても適用可能である。本発明を適用可能な他の態様としては、例えば、カメラ機能を有する携帯電話機やスマートフォン、PDA(Personal Digital Assistants)、携帯型ゲーム機が挙げられる。以下、本発明を適用可能なスマートフォンの一例について説明する。
 <スマートフォンの構成>
 図13は、本発明の撮像装置の一実施形態であるスマートフォン500の外観を示すものである。図13に示すスマートフォン500は、平板状の筐体502を有し、筐体502の一方の面に表示部としての表示パネル521と、入力部としての操作パネル522とが一体となった表示入力部520を備えている。また、筐体502は、スピーカ531と、マイクロフォン532、操作部540と、カメラ部541とを備えている。尚、筐体502の構成はこれに限定されず、例えば、表示部と入力部とが独立した構成を採用すること、あるいは折り畳み構造やスライド機構を有する構成を採用することもできる。
 図14は、図13に示すスマートフォン500の構成を示すブロック図である。図14に示すように、スマートフォンの主たる構成要素として、無線通信部510と、表示入力部520と、通話部530と、操作部540と、カメラ部541と、記憶部550と、外部入出力部560と、GPS受信部570(GPS:Global Positioning System)と、モーションセンサ部580と、電源部590と、主制御部501とを備える。主制御部501は、動画像取得部、フレーム特定部、第1画像領域決定部、第1色信号取得部、第1補正係数算出部、及び第1色補正部として機能する。
 無線通信部510は、主制御部501の指示にしたがって、移動通信網に収容された基地局に対し無線通信を行う。この無線通信を使用して、音声データ、画像データ等の各種ファイルデータ、電子メールデータなどの送受信、Webデータ及びストリーミングデータなどの受信を行う。
 表示入力部520は、主制御部501の制御により、画像(静止画像及び動画像)や文字情報などを表示して視覚的にユーザに情報を伝達し、表示した情報に対するユーザ操作を検出する、いわゆるタッチパネルであって、表示パネル521と、操作パネル522とを備える。
 表示パネル521としては、LCD(Liquid Crystal Display)、OELD(Organic Electro-Luminescence Display)などが表示デバイスとして用いられる。操作パネル522は、表示パネル521の表示面上に表示される画像を視認可能に載置され、ユーザの指やペン等によって操作される一又は複数の座標を検出するデバイスである。かかるデバイスをユーザの指やペン等によって操作すると、操作に起因して発生する検出信号を主制御部501に出力する。次いで、主制御部501は、受信した検出信号に基づいて、表示パネル521上の操作位置(座標)を検出する。
 図13に示すように、本発明の撮像装置の一実施形態として例示しているスマートフォン500の表示パネル521と操作パネル522とは一体となって表示入力部520を構成しているが、操作パネル522が表示パネル521を完全に覆うような配置となっている。かかる配置を採用した場合、操作パネル522は、表示パネル521外の領域についても、ユーザ操作を検出する機能を備えてもよい。換言すると、操作パネル522は、表示パネル521に重なる重畳部分についての検出領域(以下、表示領域と称する)と、それ以外の表示パネル521に重ならない外縁部分についての検出領域(以下、非表示領域と称する)とを備えていてもよい。
 通話部530は、スピーカ531やマイクロフォン532を備え、マイクロフォン532を通じて入力されたユーザの音声を主制御部501にて処理可能な音声データに変換して主制御部501に出力すること、無線通信部510あるいは外部入出力部560により受信された音声データを復号してスピーカ531から出力することができる。また、図13に示すように、例えばスピーカ531を表示入力部520が設けられた面と同じ面に搭載し、マイクロフォン532を筐体502の側面に搭載することができる。
 操作部540は、キースイッチなどを用いたハードウェアキーであって、ユーザからの指示を受け付けるデバイスである。例えば図13に示すように、操作部540は、スマートフォン500の筐体502の側面に搭載され、指などで押下されるとオンとなり、指を離すとバネなどの復元力によってオフ状態となる押しボタン式のスイッチである。
 記憶部550は、主制御部501の制御プログラム、制御データ、アプリケーションソフト(本発明に係る画像処理方法を実現するプログラムを含む)、通信相手の名称及び電話番号などを対応づけたアドレスデータ、送受信した電子メールのデータ、WebブラウジングによりダウンロードしたWebデータ、及びダウンロードしたコンテンツデータを記憶し、またストリーミングデータなどを一時的に記憶する。また、記憶部550は、スマートフォン内蔵の内部記憶部551と着脱自在な外部メモリスロットを有する外部記憶部562により構成される。尚、記憶部550を構成するそれぞれの内部記憶部551と外部記憶部552は、公知の記憶媒体を用いて実現される。
 外部入出力部560は、スマートフォン500に連結される全ての外部機器とのインターフェースの役割を果たす。スマートフォン500は、外部入出力部560を介して他の外部機器に通信等により直接的又は間接的に接続される。通信等の手段としては、例えば、ユニバーサルシリアルバス(USB:Universal Serial Bus)、IEEE1394、ネットワーク(例えば、インターネット、無線LAN(Local Area Network)を挙げることができる。その他、ブルートゥース(Bluetooth)(登録商標)、RFID(Radio Frequency Identification)、赤外線通信(Infrared Data Association:IrDA)(登録商標)、UWB(Ultra Wideband)(登録商標)、ジグビー(ZigBee)(登録商標)なども通信等の手段として挙げることができる。
 スマートフォン500に連結される外部機器としては、例えば、有線/無線ヘッドセット、有線/無線外部充電器、有線/無線データポート、カードソケットを介して接続されるメモリカード(Memory card)、やSIM(Subscriber Identity Module Card)/UIM(User Identity Module Card)カードが挙げられる。また、オーディオ及びビデオI/O(Input/Output)端子を介して接続される外部オーディオ及びビデオ機器、無線接続される外部オーディオ及びビデオ機器、有線/無線接続されるスマートフォン、有線/無線接続されるPDA、有線/無線接続されるパーソナルコンピュータ、イヤホンなどの外部機器も連結することができる。外部入出力部560は、このような外部機器から伝送を受けたデータをスマートフォン500の内部の各構成要素に伝達することや、スマートフォン500の内部のデータを外部機器に伝送することができる。
 モーションセンサ部580は、例えば、3軸の加速度センサや傾斜センサなどを備え、主制御部501の指示にしたがって、スマートフォン500の物理的な動きを検出すことにより、スマートフォン500の動く方向や加速度、姿勢が検出される。かかる検出結果は、主制御部501に出力されるものである。電源部590は、主制御部501の指示にしたがって、スマートフォン500の各部に、バッテリ(不図示)に蓄えられる電力を供給する。
 主制御部501は、マイクロプロセッサを備え、記憶部550が記憶する制御プログラム及び制御データにしたがって動作し、スマートフォン500の各部を統括して制御する。また、主制御部501は、無線通信部510を通じて、音声通信やデータ通信を行うために、通信系の各部を制御する移動通信制御機能と、アプリケーション処理機能を備える。
 また、主制御部501は、受信データやダウンロードしたストリーミングデータなどの画像データ(静止画像や動画像のデータ)に基づいて、映像を表示入力部520に表示する等の画像処理機能を備える。画像処理機能とは、主制御部501が、上記画像データを復号し、かかる復号結果に画像処理を施して、画像を表示入力部520に表示する機能のことをいう。
 カメラ部541は、CMOSやCCDなどの撮像素子を用いて電子撮影するデジタルカメラり、図1に示した撮像装置10に相当する。また、カメラ部541は、主制御部501の制御により、撮像によって得た画像データ(動画像、静止画像)を例えばMPEGやJPEGなどの圧縮した画像データに変換し、記憶部550に記録することや、外部入出力部560や無線通信部510を通じて出力することができる。
 また、カメラ部541はスマートフォン500の各種機能に利用することができる。例えば、表示パネル521にカメラ部541で取得した画像を表示することや、操作パネル522の操作入力のひとつとして、カメラ部541の画像を利用することができる。また、GPS受信部570が位置を検出する際に、カメラ部541からの画像を参照して位置を検出することもできる。さらには、カメラ部541からの画像を参照して、3軸の加速度センサを用いずに、あるいは、3軸の加速度センサと併用して、スマートフォン500のカメラ部541の光軸方向を判断することや、現在の使用環境を判断することもできる。勿論、カメラ部541からの画像をアプリケーションソフトウェア内で利用することもできる。
 その他、静止画像又は動画像の画像データにGPS受信部570により取得した位置情報、マイクロフォン532により取得した音声情報(主制御部等により、音声テキスト変換を行ってテキスト情報となっていてもよい)、モーションセンサ部580により取得した姿勢情報等を付加して記憶部550に記録することや、外部入出力部560や無線通信部510を通じて出力することもできる。
 図13に示すようにスマートフォン500において、カメラ部541は表示入力部520と同じ面に搭載されているが、カメラ部541の搭載位置はこれに限らず、表示入力部520の背面に搭載されてもよいし、或いは、複数のカメラ部541が搭載されてもよい。尚、複数のカメラ部541が搭載されている場合、撮影に供するカメラ部541を切り替えて単独にて撮影すること、或いは、複数のカメラ部541を同時に使用して撮影することができる。
 [その他]
 本実施形態の画像処理装置は、撮像装置10に内蔵されているが、外部のコンピュータ等により構成される画像処理装置でもよい。
 また、本発明は、撮像装置内のコンピュータ、又は外部のコンピュータにインストールされることにより、これらのコンピュータを本発明に係る画像処理装置として機能させる画像処理プログラム、及びこの画像処理プログラムが記録された記憶媒体を含む。
 更に、本実施形態では、撮像装置内で第1補正係数、第2補正係数を算出し、算出した第1補正係数、第2補正係数を補正フレームに適用してフレーム間の色味、あるいは同一フレーム内の色味をリアルタイムに補正するが、これに限らず、例えば、撮像装置では、動画像データ(RAWデータ)の取得と、補正係数(第1補正係数,又は第1補正係数と第2補正係数)の算出を行い、動画像データと補正係数とを関連付けて保存し、補正モード等で撮像装置が動画像データと補正係数とを取得し、又はコンピュータ等の外部機器が動画像データと補正係数とを取得して、動画像データのフレーム間の色味、あるいは同一フレーム内の色味を補正するようにしてもよい。この場合、補正係数は、動画ファイルのヘッダに記録してもよいし、動画ファイルと関連付けられた別のファイルに記録してもよい。
 また、撮像素子がグローバルシャッタ方式で駆動される場合には、同一フレーム内のライン画像間の色補正は不要であり、基準フレームと補正フレームとのフレーム間で色補正を行う。この場合、基準フレームと補正フレームとの同一エリア間で色補正、或いは、オブジェクト検出によって検出された基準フレームと補正フレームの同一被写体の間で色補正を行うことができる。
 また、本実施形態において、例えば、本体側CPU220、レンズ側CPU120等の各種の処理を実行する処理部(processing unit)のハードウェア的な構造は、次に示すような各種のプロセッサ(processor)である。各種のプロセッサには、ソフトウェア(プログラム)を実行して各種の処理部として機能する汎用的なプロセッサであるCPU(Central Processing Unit)、FPGA(Field Programmable Gate Array)などの製造後に回路構成を変更可能なプロセッサであるプログラマブルロジックデバイス(Programmable Logic Device:PLD)、ASIC(Application Specific Integrated Circuit)などの特定の処理を実行させるために専用に設計された回路構成を有するプロセッサである専用電気回路などが含まれる。
 1つの処理部は、これら各種のプロセッサのうちの1つで構成されていてもよいし、同種または異種の2つ以上のプロセッサ(例えば、複数のFPGA、あるいはCPUとFPGAの組み合わせ)で構成されてもよい。また、複数の処理部を1つのプロセッサで構成してもよい。複数の処理部を1つのプロセッサで構成する例としては、第1に、クライアントやサーバなどのコンピュータに代表されるように、1つ以上のCPUとソフトウェアの組合せで1つのプロセッサを構成し、このプロセッサが複数の処理部として機能する形態がある。第2に、システムオンチップ(System on Chip:SoC)などに代表されるように、複数の処理部を含むシステム全体の機能を1つのIC(Integrated Circuit)チップで実現するプロセッサを使用する形態がある。このように、各種の処理部は、ハードウェア的な構造として、上記各種のプロセッサを1つ以上用いて構成される。
 更に、これらの各種のプロセッサのハードウェア的な構造は、より具体的には、半導体素子などの回路素子を組み合わせた電気回路(circuitry)である。
 また、本発明は上述した実施形態に限定されず、本発明の精神を逸脱しない範囲で種々の変形が可能であることは言うまでもない。
10 撮像装置
20 ファインダ窓
22 シャッタレリーズスイッチ
23 シャッタスピードダイヤル
24 露出補正ダイヤル
25 電源レバー
26 接眼部
27 MENU/OKキー
28 十字キー
29 再生ボタン
30 内蔵フラッシュ
100 交換レンズ
102 撮像光学系
104 レンズ群
108 絞り
116 フォーカスレンズ制御部
118 絞り制御部
120 レンズ側CPU
122、207 RAM
124、228 ROM
126 フラッシュROM
150 レンズ側通信部
160 レンズマウント
200 カメラ本体
201 撮像素子
202 撮像素子制御部
203 アナログ信号処理部
204 A/D変換器
205 画像入力コントローラ
206 デジタル信号処理部
208 圧縮伸張処理部
210 メディア制御部
212 メモリカード
214 表示制御部
216 液晶モニタ
220 本体側CPU
222 操作部
226 フラッシュROM
230 AF検出部
232 AE制御部
234 ホワイトバランス補正部
236 無線通信部
238 GPS受信部
240 電源制御部
242 バッテリ
244 レンズ電源スイッチ
246 本体側通信部
248 本体マウント
250 本体側通信部
259 FPS制御部
260 本体マウント
260A 端子
270 フラッシュ発光部
272 フラッシュ制御部
280 フォーカルプレーンシャッタ
296 FPS制御部
300 RAWデータ
301 RAWデータ
302 動画像取得部
303 動画像取得部
310 フレーム特定部
311 フレーム特定部
312 フリッカ位相検出部
314 基準フレーム記憶領域
316 補正フレーム記憶領域
320、321 第1画像領域決定部
322 第1画像領域
324 オブジェクト検出部
330 第1色信号取得部
340 第1補正係数算出部
350 第1色補正部
410 ライン画像特定部
411 ライン画像特定部
420 第2画像領域決定部
421 第2画像領域決定部
424 オブジェクト検出部
430 第2色信号取得部
440 第2補正係数算出部
450 第2色補正部
500 スマートフォン
501 主制御部
502 筐体
510 無線通信部
520 表示入力部
521 表示パネル
522 操作パネル
530 通話部
531 スピーカ
532 マイクロフォン
540 操作部
541 カメラ部
550 記憶部
551 内部記憶部
552 外部記憶部
560 外部入出力部
562 外部記憶部
570 GPS受信部
580 モーションセンサ部
590 電源部
A 演算領域
B1 第1基準画像領域
C 演算領域
D1 第1補正画像領域
F 補正フレーム
ref 基準フレーム
S10~S24 ステップ

Claims (20)

  1.  1つ以上のプロセッサを含む画像処理装置であって、
     前記1つ以上のプロセッサは、
      撮像素子が撮像した動画像データを取得する動画像取得処理と、
      前記動画像取得処理で取得した前記動画像データを構成する複数のフレームより基準フレームと前記基準フレームに対する補正フレームを特定するフレーム特定処理と、
      前記フレーム内の第1補正係数の算出に用いる画像領域を決定し、前記基準フレームより第1基準画像領域を決定し、前記補正フレームより前記第1基準画像領域に対応する第1補正画像領域を決定する第1画像領域決定処理と、
      前記第1基準画像領域の色画像データより第1基準色信号を取得し、前記第1補正画像領域の色画像データより第1補正色信号を取得する第1色信号取得処理と、
      前記第1補正色信号を前記第1基準色信号に合わせる前記第1補正係数を算出する第1補正係数算出処理と、
     を実行するように構成されている画像処理装置。
  2.  前記1つ以上のプロセッサは、前記第1補正係数算出処理により算出された前記第1補正係数を前記補正フレームに適用して前記補正フレームの色補正を行う第1色補正処理を更に実行するように構成されている請求項1に記載の画像処理装置。
  3.  前記第1画像領域決定処理により決定される前記第1基準画像領域及び前記第1補正画像領域はそれぞれ複数の画像領域であり、かつ各画像領域は特定画素又は前記特定画素を含む周辺画素の画像領域である請求項1又は2に記載の画像処理装置。
  4.  前記第1基準色信号及び前記第1補正色信号は、それぞれ複数の色信号から構成される請求項3に記載の画像処理装置。
  5.  前記第1基準色信号の複数の色信号を赤色のRref、緑色のGref、青色のBrefとし、前記第1補正色信号の複数の色信号を赤色のR、緑色のG、青色のBとすると、前記第1補正係数算出処理は、前記複数の画像領域において、次式、
     Rref=α1・R+β1・G+γ1・B+Δ1
     Gref=α2・R+β2・G+γ2・B+Δ2
     Bref=α3・R+β3・G+γ3・B+Δ3
    を成立させる前記第1補正係数であるα1、α2、α3、β1、β2、β3、γ1、γ2、γ3、Δ1、Δ2、Δ3を算出する請求項4に記載の画像処理装置。
  6.  前記第1補正係数算出処理は、前記複数の画像領域において、RrefとR、GrefとG、及びBrefとBの差がそれぞれ最小になる前記α1、α2、α3、β1、β2、β3、γ1、γ2、γ3、Δ1、Δ2、Δ3を算出する請求項5に記載の画像処理装置。
  7.  前記動画像データは、前記撮像素子上に形成される画素に対し、少なくとも1つ以上の画素毎又は走査ライン毎に順次露光動作が行われて撮像されたものであり、
     前記第1画像領域決定処理は、前記基準フレーム及び前記補正フレームにおいて、前記撮像素子の露光開始と露光終了のタイミングが同じ画像領域からそれぞれ前記第1基準画像領域及び前記第1補正画像領域を決定する請求項1から6のいずれか1項に記載の画像処理装置。
  8.  前記第1画像領域決定処理は、前記基準フレームにおける前記第1基準画像領域と前記補正フレームにおける第1補正画像領域とをフレーム内の同じ位置とする請求項1から7のいずれか1項に記載の画像処理装置。
  9.  前記1つ以上のプロセッサは、前記動画像データより光源のフリッカの位相を検出するフリッカ位相検出処理を実行するように構成され、
     前記フレーム特定処理は、前記フリッカの位相を用いて前記基準フレームを特定する請求項1から8のいずれか1項に記載の画像処理装置。
  10.  前記フレーム特定処理は、前記第1色補正処理により色補正された前記補正フレームを、次の補正フレームに対する基準フレームとして特定する請求項2に記載の画像処理装置。
  11.  前記動画像取得処理は、フレーム間隔よりも1フレーム当りの露光時間が短い複数のフレームから構成される前記動画像データを取得する請求項1から10のいずれか1項に記載の画像処理装置。
  12.  前記動画像データは、フリッカを有する光源下で前記撮像素子上に形成される画素に対し、少なくとも1つ以上の画素毎又は走査ライン毎に順次露光動作が行われて撮像されたものであり、
     前記動画像取得処理は、1フレーム当りの露光時間がフレーム間隔よりも短く、かつ前記光源のフリッカの周期よりも短い複数のフレームから構成される前記動画像データを取得し、
     前記1つ以上のプロセッサは、
      前記動画像データを構成する各フレームにおいて、基準走査ライン上のライン画像を基準ライン画像として特定し、前記基準走査ラインに隣接する走査ライン上のライン画像を補正ライン画像として特定するライン画像特定処理と、
      前記ライン画像内の第2補正係数の算出に用いる画像領域を決定し、前記基準ライン画像より第2基準画像領域を決定し、前記補正ライン画像より前記第2基準画像領域に対応する第2補正画像領域を決定する第2画像領域決定処理と、
      前記第2基準画像領域の色画像データより第2基準色信号を取得し、前記第2補正画像領域の色画像データより第2補正色信号を取得する第2色信号取得処理と、
      前記第2補正色信号を前記第2基準色信号に合わせる第2補正係数を算出する第2補正係数算出処理と、
      前記第2補正係数算出処理により算出された第2補正係数を前記補正ライン画像に適用して前記補正ライン画像の色補正を行う第2色補正処理と、を実行するように構成され、
     前記ライン画像特定処理は、前記第2色補正処理により色補正された前記補正ライン画像を、次の補正ライン画像に対する基準ライン画像として特定する請求項1から11のいずれか1項に記載の画像処理装置。
  13.  前記動画像データは、フリッカを有する光源下で前記撮像素子上に形成される画素に対し、少なくとも1つ以上の画素毎又は走査ライン毎に順次露光動作が行われて撮像されたものであり、
     前記動画像取得処理は、1フレーム当りの露光時間がフレーム間隔よりも短く、かつ前記光源のフリッカの周期よりも短い複数のフレームから構成される前記動画像データを取得し、
     前記1つ以上のプロセッサは、
      前記動画像データを構成する各フレームにおいて、基準走査ライン上のライン画像を基準ライン画像として特定し、前記基準走査ライン以外の走査ライン上のライン画像を補正ライン画像として特定するライン画像特定処理と、
      前記ライン画像内の第2補正係数の算出に用いる画像領域を決定し、前記基準ライン画像より第2基準画像領域を決定し、前記補正ライン画像毎に前記第2基準画像領域に対応する第2補正画像領域を決定する第2画像領域決定処理と、
      前記第2基準画像領域の色画像データより第2基準色信号を取得し、前記第2補正画像領域の色画像データより第2補正色信号を取得する第2色信号取得処理と、
      前記第2補正色信号を前記第2基準色信号に合わせる第2補正係数を算出する第2補正係数算出処理と、
      前記算出された第2補正係数を前記補正ライン画像に適用して前記補正ライン画像の色補正を行う第2色補正処理と、を実行するように構成され、
     前記第2画像領域決定処理は、前記補正ライン画像内の、前記基準ライン画像の前記第2基準画像領域の色と色が近似する画像領域を前記第2補正画像領域として決定する請求項1から11のいずれか1項に記載の画像処理装置。
  14.  前記1つ以上のプロセッサは、前記フレームからオブジェクトを検出するオブジェクト検出処理を実行するように構成され、
     前記第2画像領域決定処理は、前記オブジェクト検出処理により検出された、前記基準ライン画像の前記第2基準画像領域に含まれるオブジェクトと同じオブジェクトを含む、前記補正ライン画像の画像領域を前記第2補正画像領域として決定する請求項13に記載の画像処理装置。
  15.  動画像を撮像する撮像素子と、
     請求項1から14のいずれか1項に記載の画像処理装置と、を備え、
     前記動画像取得処理は、前記撮像素子が撮像した前記動画像を示す動画像データを取得する撮像装置。
  16.  撮像素子が撮像した動画像データを取得するステップと、
     前記動画像データを構成する複数のフレームより基準フレームと前記基準フレームに対する補正フレームを特定するステップと、
     前記フレーム内の第1補正係数の算出に用いる画像領域を決定し、前記基準フレームより複数の第1基準画像領域を決定し、前記補正フレームより前記複数の第1基準画像領域に対応する複数の第1補正画像領域を決定するステップと、
     前記複数の第1基準画像領域毎の色画像データより複数の第1基準色信号を取得し、前記複数の第1補正画像領域毎の色画像データより複数の第1補正色信号を取得するステップと、
     前記複数の第1補正色信号を前記複数の第1基準色信号に合わせる前記第1補正係数を算出するステップと、
     前記算出された前記第1補正係数を前記補正フレームに適用して前記補正フレームの色補正を行うステップと、
     を含む画像処理方法。
  17.  前記第1基準色信号を赤色のRref、緑色のGref、青色のBrefとし、前記第1補正色信号を赤色のR、緑色のG、青色のBとすると、前記第1補正係数を算出するステップは、前記複数の画像領域において、次式、
     Rref=α1・R+β1・G+γ1・B+Δ1
     Gref=α2・R+β2・G+γ2・B+Δ2
     Bref=α3・R+β3・G+γ3・B+Δ3
    を成立させる前記第1補正係数であるα1、α2、α3、β1、β2、β3、γ1、γ2、γ3、Δ1、Δ2、Δ3を算出する請求項16に記載の画像処理方法。
  18.  前記第1補正係数を算出するステップは、前記複数の画像領域において、RrefとR、GrefとG、及びBrefとBの差がそれぞれ最小になる前記α1、α2、α3、β1、β2、β3、γ1、γ2、γ3、Δ1、Δ2、Δ3を算出する請求項17に記載の画像処理方法。
  19.  撮像素子が撮像した動画像データを取得する機能と、
     前記動画像データを構成する複数のフレームより基準フレームと前記基準フレームに対する補正フレームを特定する機能と、
     前記フレーム内の第1補正係数の算出に用いる画像領域を決定し、前記基準フレームより複数の第1基準画像領域を決定し、前記補正フレームより前記複数の第1基準画像領域に対応する複数の第1補正画像領域を決定する機能と、
     前記複数の第1基準画像領域毎の色画像データより複数の第1基準色信号を取得し、前記複数の第1補正画像領域毎の色画像データより複数の第1補正色信号を取得する機能と、
     前記複数の第1補正色信号を前記複数の第1基準色信号に合わせる前記第1補正係数を算出する機能と、
     前記算出された前記第1補正係数を前記補正フレームに適用して前記補正フレームの色補正を行う機能と、
     をコンピュータにより実現させる画像処理プログラム。
  20.  非一時的かつコンピュータ読取可能な記録媒体であって、前記記録媒体に格納された指令がコンピュータによって読み取られた場合に請求項19に記載の画像処理プログラムをコンピュータに実行させる記録媒体。
PCT/JP2020/021934 2019-06-18 2020-06-03 画像処理装置、撮像装置、画像処理方法及び画像処理プログラム WO2020255715A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2021527556A JP7234361B2 (ja) 2019-06-18 2020-06-03 画像処理装置、撮像装置、画像処理方法及び画像処理プログラム
JP2023026203A JP7422911B2 (ja) 2019-06-18 2023-02-22 画像処理装置、撮像装置、画像処理方法、画像処理プログラム及び記録媒体
JP2024004743A JP2024036370A (ja) 2019-06-18 2024-01-16 画像処理装置、撮像装置、画像処理方法、画像処理プログラム及び記録媒体

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2019113020 2019-06-18
JP2019-113020 2019-06-18

Publications (1)

Publication Number Publication Date
WO2020255715A1 true WO2020255715A1 (ja) 2020-12-24

Family

ID=74037265

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2020/021934 WO2020255715A1 (ja) 2019-06-18 2020-06-03 画像処理装置、撮像装置、画像処理方法及び画像処理プログラム

Country Status (2)

Country Link
JP (3) JP7234361B2 (ja)
WO (1) WO2020255715A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113724165A (zh) * 2021-09-02 2021-11-30 中国科学院空天信息创新研究院 合成孔径雷达镶嵌影像匀色处理方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006059573A1 (ja) * 2004-12-02 2006-06-08 Matsushita Electric Industrial Co., Ltd. 色彩調整装置及び方法
JP2008306266A (ja) * 2007-06-05 2008-12-18 Nippon Telegr & Teleph Corp <Ntt> 情報処理装置、情報処理方法、プログラムおよび記録媒体
KR20150014687A (ko) * 2013-07-30 2015-02-09 경희대학교 산학협력단 입체 영상의 부호화를 위한 전처리 장치
JP2017184265A (ja) * 2017-06-01 2017-10-05 株式会社朋栄 フリッカーを除去する画像処理方法とその画像処理装置
JP2018509027A (ja) * 2015-01-15 2018-03-29 トムソン ライセンシングThomson Licensing 動きに基づくビデオ色調安定化のための方法及び装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8040392B2 (en) * 2004-11-15 2011-10-18 Sony Corporation Flicker correcting method, flicker correcting circuit, and imaging device using them
JP4353223B2 (ja) 2006-09-07 2009-10-28 ソニー株式会社 画像データ処理装置、画像データ処理方法および撮像システム
JP2008109370A (ja) 2006-10-25 2008-05-08 Sanyo Electric Co Ltd 画像補正装置及び方法並びに撮像装置
JP2009253808A (ja) * 2008-04-09 2009-10-29 Sony Corp 画像処理装置、撮像装置、画像処理方法、およびプログラム
JP5656613B2 (ja) * 2010-12-22 2015-01-21 キヤノン株式会社 撮像装置及びその制御方法
JP6576028B2 (ja) * 2014-10-21 2019-09-18 キヤノン株式会社 画像処理装置及び画像処理方法
DE102016109887B4 (de) * 2016-05-30 2020-05-28 Dream Chip Technologies Gmbh Verfahren zur Erkennung und Korrektur von Bildfehlern sowie Bildverarbeitungseinheit und Computerprogramm hierzu

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006059573A1 (ja) * 2004-12-02 2006-06-08 Matsushita Electric Industrial Co., Ltd. 色彩調整装置及び方法
JP2008306266A (ja) * 2007-06-05 2008-12-18 Nippon Telegr & Teleph Corp <Ntt> 情報処理装置、情報処理方法、プログラムおよび記録媒体
KR20150014687A (ko) * 2013-07-30 2015-02-09 경희대학교 산학협력단 입체 영상의 부호화를 위한 전처리 장치
JP2018509027A (ja) * 2015-01-15 2018-03-29 トムソン ライセンシングThomson Licensing 動きに基づくビデオ色調安定化のための方法及び装置
JP2017184265A (ja) * 2017-06-01 2017-10-05 株式会社朋栄 フリッカーを除去する画像処理方法とその画像処理装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113724165A (zh) * 2021-09-02 2021-11-30 中国科学院空天信息创新研究院 合成孔径雷达镶嵌影像匀色处理方法

Also Published As

Publication number Publication date
JP2023059952A (ja) 2023-04-27
JP2024036370A (ja) 2024-03-15
JP7422911B2 (ja) 2024-01-26
JPWO2020255715A1 (ja) 2020-12-24
JP7234361B2 (ja) 2023-03-07

Similar Documents

Publication Publication Date Title
JP6302554B2 (ja) 画像処理装置、撮像装置、画像処理方法及び画像処理プログラム
US9351002B2 (en) Image processing apparatus, image pickup apparatus, computer, image processing method and computer readable non-transitory medium
KR102375688B1 (ko) 촬상 장치, 촬영 시스템 및 촬영 방법
US8860876B2 (en) Image display using flash reach information
JP2024036370A (ja) 画像処理装置、撮像装置、画像処理方法、画像処理プログラム及び記録媒体
US11201999B2 (en) Imaging device, information acquisition method, and information acquisition program
US10791260B2 (en) Imaging device, information acquisition method, and information acquisition program
US11032483B2 (en) Imaging apparatus, imaging method, and program
JP7112529B2 (ja) 撮像装置、撮像方法、及びプログラム
WO2020158069A1 (ja) 撮像装置、撮像方法、及びプログラム
WO2019208155A1 (ja) 画像処理装置、方法、及びプログラム並びに撮像装置
JP6998454B2 (ja) 撮像装置、撮像方法、プログラム及び記録媒体
JP2016143951A (ja) 画像処理装置、撮像装置、画像処理方法及び画像処理プログラム
JP2012119788A (ja) 撮影装置、画像処理装置、撮影方法及び画像処理方法
WO2020161969A1 (ja) 画像処理装置、撮影装置、画像処理方法及び画像処理プログラム
JP6875603B2 (ja) 撮像装置、撮像方法、及びプログラム
JP6810298B2 (ja) 画像位置合わせ補助装置、方法及びプログラム並びに撮像装置
JP6941744B2 (ja) 画像処理装置、撮影装置、画像処理方法及び画像処理プログラム
JP2010178112A (ja) 撮像装置およびテレビドアホン装置
JP2006060650A (ja) オートホワイトバランス調整方法及び装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20825115

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021527556

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20825115

Country of ref document: EP

Kind code of ref document: A1