WO2011021235A1 - 画像処理方法および画像処理装置 - Google Patents

画像処理方法および画像処理装置 Download PDF

Info

Publication number
WO2011021235A1
WO2011021235A1 PCT/JP2009/003930 JP2009003930W WO2011021235A1 WO 2011021235 A1 WO2011021235 A1 WO 2011021235A1 JP 2009003930 W JP2009003930 W JP 2009003930W WO 2011021235 A1 WO2011021235 A1 WO 2011021235A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
shift amount
images
noise
image processing
Prior art date
Application number
PCT/JP2009/003930
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 PCT/JP2009/003930 priority Critical patent/WO2011021235A1/ja
Priority to JP2011527480A priority patent/JP5158262B2/ja
Publication of WO2011021235A1 publication Critical patent/WO2011021235A1/ja
Priority to US13/367,707 priority patent/US20120133786A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/68Control of cameras or camera modules for stable pick-up of the scene, e.g. compensating for camera body vibrations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/30Determination of transform parameters for the alignment of images, i.e. image registration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/68Control of cameras or camera modules for stable pick-up of the scene, e.g. compensating for camera body vibrations
    • H04N23/682Vibration or motion blur correction
    • H04N23/684Vibration or motion blur correction performed by controlling the image sensor readout, e.g. by controlling the integration time
    • H04N23/6845Vibration or motion blur correction performed by controlling the image sensor readout, e.g. by controlling the integration time by combination of a plurality of images sequentially taken
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence

Definitions

  • the present invention relates to a method and apparatus for processing a digital image, and can be applied to a method of correcting camera shake of an electronic camera using a plurality of images, for example.
  • the camera shake correction function is realized by an optical technique or an image processing technique.
  • the camera shake width can be reduced by shortening the exposure time.
  • the exposure time is shortened, the amount of light is insufficient, and noise on the image increases. Therefore, camera shake correction by image processing is realized by shortening the exposure time and, for example, combining a plurality of images obtained by continuous shooting after alignment.
  • Camera shake occurs when the camera moves during shooting.
  • the movement of the camera is defined by the six elements shown in FIG. (1) YAW (2) PITCH (3) Horizontal translation (4) Vertical translation (5) ROLL (6) Forward / backward translation
  • YAW YAW
  • PITCH Horizontal translation
  • ROLL Vertical translation
  • FIG. 1 the relationship between the camera motion element and the image shift component is as shown in FIG.
  • the camera shake correction processing for example, the amount of blur between two images (first and second images) obtained by continuous shooting is detected, and the second image is converted so as to compensate for the amount of blur (for example, affine transformation is performed. That is, alignment is performed. Then, by combining the first image and the converted second image, an image in which camera shake is corrected is obtained.
  • dx is the horizontal shift amount
  • dy is the vertical shift amount
  • is the rotation angle of the camera in the ROLL direction
  • S is an enlargement / reduction ratio generated by the camera moving in the perspective direction.
  • (X, y) is the coordinates of the image before conversion
  • (x ′, y ′) is the coordinates of the image after conversion.
  • FIG. 3 An example of image conversion by affine transformation is shown in FIG. In the example shown in FIG. 3, the image is translated and rotated clockwise by affine transformation.
  • each pixel of the image before conversion and each pixel of the image after conversion do not correspond one-to-one. That is, each pixel of the image after conversion is generally represented by a plurality of pixels of the image before conversion. For example, in the example shown in FIG. 4, the pixel E of the image after conversion is represented by four pixels A to D of the image before conversion.
  • the pixel value of the converted pixel E for example, one of the pixels A to D (for example, the pixel C) can be used.
  • this method there is a possibility that jaggy occurs on the contour line of the image.
  • the pixel value P of the pixel E is calculated by the following equation.
  • P Sa ⁇ Pa + Sb ⁇ Pb + Sc ⁇ Pc + Sd ⁇ Pd
  • the pixel values Sa to Sd of the pixels A to D are the area occupied by the pixel E on the pixels A to D.
  • the following image processing apparatus has been proposed. That is, a multi-resolution image of the reference image and the comparison image is created. For images with low resolution, full range matching is performed to detect a two-dimensional shift between images.
  • Patent Document 1 For an image having a relatively high resolution, a shift for each block is detected by block matching. For the high resolution in order from the lowest resolution, the motion data obtained in the previous stage is used as an initial value, and the motion data is corrected with a higher resolution image, thereby achieving high accuracy.
  • Patent Document 1 As other related techniques, image processing methods described in Patent Documents 2 to 4 have been proposed.
  • the affine transformation it is necessary to perform a complicated matrix operation on all pixels in order to correct a positional shift caused by rotation or enlargement / reduction. That is, the affine transformation is computationally intensive.
  • the image may be blurred if each pixel value of the transformed image is interpolated using the surrounding pixel values. In this case, the image quality of the composite image also deteriorates.
  • An object of the present invention is to reduce the amount of calculation of processing for generating a composite image using a plurality of images.
  • An image processing method is a method of generating a composite image from first and second images among a plurality of images obtained by continuous shooting, wherein the first and second images A noise parameter is detected based on the image, a shift amount for reducing the noise parameter is calculated, and a converted image is generated by shifting the coordinates of each pixel of the second image according to the shift amount. A composite image is generated by combining the image and the converted image.
  • the amount of processing for generating a composite image using a plurality of images is reduced.
  • Digital cameras may be required to have a function for suppressing the effects of camera shake.
  • the exposure time for image capturing is shortened, the influence of camera shake is suppressed.
  • the exposure time is short, noise occurs in the image.
  • the electronic camera shake correction generally, a plurality of images obtained by continuous shooting are combined in order to suppress random noise. Then, by the short exposure photography and the image synthesis, it is possible to obtain a camera shake correction image in which the influence of camera shake is small and noise is suppressed.
  • FIG. 5 is a flowchart illustrating an example of camera shake correction processing.
  • camera shake is corrected using two images obtained by continuous shooting.
  • two images a first image and a second image
  • a shift amount of the second image with respect to the first image is calculated.
  • the second image is converted so as to correct the calculated shift amount.
  • the first image and the converted second image are combined. Thereby, a camera shake correction image is generated.
  • step S3 of FIG. 5 affine transformation is performed in step S3 of FIG.
  • affine transformation is computationally intensive.
  • the second image is simply translated in step S3 of FIG. Since the parallel movement of the image is realized only by shifting the coordinates of each pixel, the amount of calculation is small.
  • step S2 in FIG. 5 is not an essential procedure.
  • FIG. 6 is a diagram illustrating a configuration of the image processing apparatus according to the first embodiment.
  • this image processing apparatus is not specifically limited, For example, it is mounted in a digital camera (or electronic camera).
  • the image photographing unit 1 includes a CCD image sensor or a CMOS image sensor, for example, and generates a digital image.
  • the image photographing unit 1 has a continuous photographing function.
  • the image capturing unit 1 can obtain a plurality of images (first image and second image) captured within a short time by one shutter pressing operation.
  • the image holding units 2A and 2B hold the first image and the second image obtained by the image photographing unit 1, respectively.
  • the image holding units 2A and 2B are, for example, semiconductor memories.
  • the first and second images are two arbitrary images among a plurality of images obtained by continuous shooting.
  • the first image may be an image taken before the second image, or may be an image taken after the second image.
  • the converted second image is also held in the image holding unit 2B.
  • the difference calculation unit 3 calculates a difference between a set of images held by the image holding units 2A and 2B. That is, a difference image is generated. At this time, a difference in pixel value is calculated for each pixel of the set of images.
  • the pixel value generally includes luminance data and color data, but in this embodiment, for example, a difference between the luminance data of each pixel is calculated.
  • the motion region detection unit 4 refers to the calculation result of the difference calculation unit 3 and detects a pixel in which the difference in pixel value between images is larger than a predetermined threshold value.
  • a predetermined threshold value an area where the pixel value difference is larger than a predetermined threshold value may be referred to as a “motion area”.
  • the moving area is generated by, for example, camera shake during shooting. However, even if camera shake occurs, an area where the same pixel value is uniformly spread (for example, an area where the blue sky of a landscape image is spread) does not change the pixel value of the corresponding pixel between images. It is not a moving area.
  • the shift amount selection unit 5 selects a shift amount (X direction movement amount and Y direction movement amount) for converting the second image.
  • the shift amount may be selected from a predetermined range.
  • the shift amount is expressed in units of pixels. That is, the shift amount is represented by integers (including zero and negative values) that indicate the shift amounts in the horizontal direction and the vertical direction.
  • the image shift unit 6 shifts each pixel of the second image held in the image holding unit 2B in the horizontal direction and / or the vertical direction according to the shift amount selected by the shift amount selection unit 5.
  • the shift amount determination unit 7 determines a shift amount in which the motion region detected by the motion region detection unit 4 satisfies a predetermined condition. Then, the shift amount determination unit 7 outputs an image synthesis instruction when the motion region satisfies a predetermined condition.
  • the image composition unit 8 When the image composition unit 8 receives the image composition instruction from the shift amount determination unit 7, the image composition unit 8 composes a set of images held in the image holding units 2A and 2B. At this time, the first image is held in the image holding unit 2A.
  • the image holding unit 2B holds a second image that is shifted so that the motion region satisfies a predetermined condition. That is, the converted image of the first image and the second image is synthesized.
  • the image composition unit 8 outputs the pixel value of one (for example, the first image) of one set of images without performing addition of pixel values for the motion region.
  • FIG. 7 is a diagram for explaining the outline of the image composition method according to the first embodiment. Note that FIG. 7A is one of the first image and the second image obtained by continuous shooting.
  • FIG. 7B is a diagram showing a positional deviation between the first and second images due to camera shake.
  • camera shake occurs due to six elements.
  • the positional shift caused by the horizontal translation and the vertical translation is the same for all coordinates on the image.
  • the displacement due to YAW and PITCH is approximately the same in all coordinates on the image. Therefore, the positional shift caused by these four elements is almost the same in all coordinates on the image. That is, in FIG. 7B, the parallel displacement component of the positional shift of the pixels P1 to P4 between the first and second images (the horizontal shift, the vertical shift, the sum of the positional shift caused by YAW and PITCH).
  • the translation vectors T1 to T4 representing are substantially the same.
  • a shake component (rotation component) generated due to ROLL differs depending on the coordinates in the image. That is, the rotation vectors R1 to R4 representing the rotation components of camera shake of the pixels P1 to P4 are different from each other.
  • the pixel P1 is moved rightward
  • the pixel P2 is moved downward
  • the pixel P3 is moved leftward
  • the pixel P4 is moved upward.
  • the positional deviation caused by the front-rear parallel movement also differs depending on the coordinates in the image, similarly to the positional deviation caused by ROLL.
  • the positional deviation caused by the back-and-forth parallel movement is smaller than the positional deviation caused by ROLL.
  • the vectors S1 to S4 representing the positional deviations of the pixels P1 to P4 are the sums of the translation vectors T1 to T4 and the rotation vectors R1 to R4, respectively.
  • alignment is realized by parallel movement of the images.
  • the alignment process for example, a translation process for compensating for the translation vectors T1 to T4 shown in FIG.
  • FIG. 7 (c) shows a difference image between the first image and the second image in which the translation vectors T1 to T4 are compensated.
  • a region that is, a motion region
  • the difference in pixel values between these one set of images is larger than the threshold value is represented in black. In this case, since the rotation component is not compensated, the motion region is large.
  • the image composition unit 8 outputs the pixel value of one (for example, the first image) of one set of images without performing addition of pixel values for the motion region. .
  • the noise reduction effect by image synthesis cannot be obtained, and there is a risk that the image quality deteriorates (the image quality cannot be improved). For this reason, in an image composition process, it is preferable that there are few motion areas.
  • the second image is shifted so that the motion region becomes smaller, and the first image and the shifted second image are combined.
  • the motion region is uniformly distributed over the entire image.
  • the shift amount of the second image is determined so as to compensate for the displacement of the pixel generated in the lower region in the image.
  • the shift process is performed on the entire second image so as to compensate for the camera shake vector S3 of the pixel P3.
  • FIG. 7D shows a difference image between the first image and the second image subjected to the shift process so as to compensate for the position shift of the lower region.
  • the motion area (area represented in black) is smaller than in the example shown in FIG. For this reason, the area where the images are combined increases, and the noise of the combined image decreases.
  • the shift amount of the upper region may increase.
  • the upper area has a small movement area in this example. That is, the upper region is a region where the change in pixel value is small. For this reason, even if the positional deviation between the first and second images is large, it is difficult to recognize deterioration in image quality in the composite image. Therefore, the synthesized image obtained by the method of the first embodiment has less recognized noise as a whole.
  • FIG. 8 is a flowchart showing a procedure for calculating the shift amount in the first embodiment.
  • the shift amounts dx and dy are the shift amounts of the coordinates of each pixel, and both are integers. Note that coordinate conversion by shift processing (parallel movement) is expressed by the following equation (2).
  • “Dx” is the horizontal shift amount
  • “dy” is the vertical shift amount
  • (X, y) is the coordinates of the image before conversion
  • (x ′, y ′) is the coordinates of the image after conversion.
  • step S11 the image capturing unit 1 acquires two images (first and second images) by continuous shooting.
  • the first and second images are held in the image holding units 2A and 2B, respectively.
  • step S12 the difference calculation unit 3 generates a difference image between the first image and the second image. Then, the motion region detection unit 4 detects a motion region in this difference image. As described above, the motion region is a region where the absolute value of the difference between pixel values between images is larger than a threshold value. Note that the motion region obtained in step S12 is an initial motion region obtained from a set of images before image conversion is performed, and will be referred to as “motion region A” in the following description.
  • step S13 the shift amount selection unit 5 initializes variables dx and dy for calculating the shift amount (parallel movement amount). Subsequently, in step S ⁇ b> 14, the image shift unit 6 shifts the coordinates of each pixel of the second image by the shift amounts dx and dy selected by the shift amount selection unit 5. That is, the parallel movement is executed with respect to the second image. Then, the second image subjected to the coordinate shift is written in the image holding unit 2B.
  • the shift amount selection unit 5 may select the shift amounts dx and dy according to a predetermined algorithm. At this time, the shift amount selection unit 5 outputs different shift amounts dx and dy in order each time Steps S14 to S17 are repeatedly executed. An example of the shift amount selected in order is shown below.
  • step S15 the difference calculation unit 3 generates a difference image between the first image and the second image subjected to coordinate shift. Then, the motion region detection unit 4 detects a motion region in this difference image. In the following description, the motion region obtained in step S15 is referred to as “motion region B”.
  • step S16 the shift amount determination unit 7 compares the areas of the motion area A and the motion area B. If the area of the motion region B is larger than the area of the motion region A, it is checked in step S17 whether the number of executions of steps S14 to S16 has reached a predetermined value. If the number of executions of steps S14 to S16 has not reached the predetermined value, the process returns to step S14.
  • the shift amount determination unit 7 holds the shift amounts dx and dy selected by the shift amount selection unit 5 at that time. That is, the shift amounts dx and dy are determined.
  • the state where the motion region B is smaller than the motion region A means that the new motion region becomes smaller than the initial motion region by shifting the second image.
  • the shift amount of the second image is determined so as to reduce the motion region.
  • the shift amount obtained by the image processing method of the first embodiment may be referred to as “dx1, dy1”.
  • the shift amount determination unit 7 determines the shift amounts dx and dy
  • the shift amount determination unit 7 outputs an image composition instruction.
  • the image synthesis unit 8 synthesizes a set of images held in the image holding units 2A and 2B.
  • the first image is held in the image holding unit 2A.
  • the image holding unit 2B holds the second image shifted by the shift amounts dx and dy calculated in steps S11 to S18. That is, the first image and the shifted second image are synthesized.
  • the second image is converted so that the motion region between the first and second images is reduced, and the first image and the converted second image are converted. Are synthesized. At this time, the conversion of the second image is realized only by shifting the coordinates of each pixel in units of pixels. Therefore, image composition is realized with a small amount of calculation, and camera shake is corrected.
  • the noise of the composite image depends on the size of the motion region between the first and second images, as described above. That is, the size of the motion area is an index representing noise of the composite image. Therefore, the difference calculation unit 3 and the motion region detection unit 4 illustrated in FIG. 6 operate as a noise parameter detection unit that detects a noise parameter.
  • the shift amount selection unit 5 and the shift amount determination unit 7 operate as a shift amount calculation unit that calculates the shift amount so as to reduce the noise parameter detected by the noise parameter detection unit.
  • FIG. 9 is a diagram illustrating a configuration of the image processing apparatus according to the second embodiment.
  • the image capturing unit 1, the image holding units 2A and 2B, the shift amount selecting unit 5, the image shifting unit 6, and the image combining unit 8 are basically the same as those in the first embodiment. The same.
  • the noise calculation unit 11 calculates the noise feeling of the combined image generated by the image combining unit 8.
  • the noise feeling is calculated by extracting the noise component of the composite image.
  • the noise component is calculated by the following equation.
  • Noise component original image ⁇ blurred image of the original image
  • the sense of noise is, for example, the sum of noise components calculated for each pixel.
  • a high noise state corresponds to a state where the difference between the original image and the blurred image of the original image (that is, the noise component) is large and the sum of the noise components is large.
  • the state where the noise is low corresponds to a state where the difference between the original image and the blurred image of the original image (that is, the noise component) is small and the sum of the noise components is small.
  • the noise feeling is not limited to this example, and may be expressed by other parameters.
  • FIG. 10A is a diagram for explaining a method of extracting a noise component of a composite image.
  • the blurred image is generated by performing a smoothing filter operation on the composite image.
  • the smoothing filter is realized by, for example, the calculation illustrated in FIG. 10B.
  • a difference between the pixel values is calculated between the original image and the blurred image after the smoothing filter operation.
  • the noise component of the composite image is obtained by calculating the sum of absolute values of differences between the pixel values.
  • the shift amount determination unit 12 determines a shift amount in which the noise feeling calculated by the noise calculation unit 11 satisfies a predetermined condition. Then, the shift amount determination unit 12 outputs an image composition instruction when the sense of noise satisfies a predetermined condition.
  • the switch 13 When the switch 13 receives the image composition instruction from the shift amount determination unit 12, the switch 13 outputs the composite image generated by the image composition unit 8. That is, when the noise feeling of the composite image satisfies a predetermined condition, the composite image is output.
  • FIG. 11 is a flowchart showing a procedure for calculating the shift amount in the second embodiment. Also in the second embodiment, the shift amounts dx and dy are calculated. The procedure of the second embodiment is basically the same as that of the first embodiment. However, in the first embodiment, the shift amount is calculated based on the area of the motion region, but in the second embodiment, the shift amount is calculated based on the sense of noise.
  • step S21 the image photographing unit 1 acquires two images (first and second images) by continuous photographing.
  • step S22 the noise calculation unit 11 calculates the noise feeling of the composite image of the first and second images.
  • the noise feeling obtained in step S22 is referred to as “noise feeling C”.
  • Steps S23 and S24 are the same as steps S13 and S14 of the first embodiment. That is, in step S23, the shift amounts dx and dy are initialized. In step S24, coordinate shift is performed on the second image by the shift amounts dx and dy selected by the shift amount selection unit 5. At this time, the image composition unit 8 generates a composite image of the first image and the second image subjected to coordinate shift.
  • step S25 the noise feeling of the newly generated composite image is calculated.
  • the noise feeling obtained in step S25 is referred to as “noise feeling D”.
  • step S ⁇ b> 26 the shift amount determination unit 12 compares the noise feeling C and the noise feeling D. If the noise sensation D is greater than the noise sensation C, it is checked in step S27 whether or not the number of executions of steps S24 to S26 has reached a predetermined value. If the number of executions of steps S24 to S26 has not reached the predetermined value, the process returns to step S24.
  • the shift amount determination unit 12 holds the shift amounts dx and dy selected by the shift amount selection unit 5 at that time. That is, the shift amounts dx and dy for converting the second image are determined.
  • the state where the noise sensation D is less than the noise sensation C means that the noise of the composite image has been reduced by translating the second image.
  • the shift amount of the second image is determined so as to reduce the noise.
  • the shift amount obtained by the image processing method of the second embodiment may be referred to as “dx2, dy2”.
  • the shift amount determination unit 12 determines the shift amounts dx and dy
  • the shift amount determination unit 12 outputs an image composition instruction.
  • the switch 13 outputs the composite image generated by the image composition unit 8.
  • the image composition unit 8 generates a composite image with less noise. Therefore, a composite image with less noise is generated.
  • the second image is converted so as to reduce noise in the synthesized image of the first and second images, and the first image and the converted first image are converted. Two images are combined. At this time, the conversion of the second image is realized only by shifting the coordinates of each pixel. Therefore, image composition is realized with a small amount of calculation, and camera shake is corrected.
  • the noise calculation unit 11 operates as a noise parameter detection unit that detects a noise parameter.
  • the shift amount selection unit 5 and the shift amount determination unit 12 are shift amount calculation units that calculate the shift amount so as to reduce the noise parameter detected by the noise parameter detection unit (in the second embodiment, the noise feeling). Works as.
  • the noise of the image has the property that the region where the variation of the pixel value is more noticeable than the region where the variation of the pixel value in the image is large. This property is because when the fluctuation of the pixel value is large, the noise is buried in the fluctuation of the pixel value, and it becomes difficult for human eyes to discriminate the density of the noise. Therefore, by reducing the weight of the area where the gradation variation of the blurred image is large (the area where the pixel value variation of the original image is large) and increasing the weight of the area where the gradation variation is small, the noise sensation Nr of the image is obtained by the following equation. Can be quantified.
  • the gradation variation s is “1” when the parameter J is larger than the threshold, and is “0” when the parameter J is less than or equal to the threshold.
  • the noise index of each pixel is also zero.
  • the noise index of the motion region depends on the gradation variation s. That is, the noise index of the pixel belonging to the region where the gradation variation s is larger than the threshold value Nth is “1”, and the noise index of the pixel belonging to the region where the gradation variation s is equal to or less than the threshold value Nth is “2”.
  • the noise sensation Nr is obtained by calculating the sum of the noise indexes of each pixel. In steps S22 and S25 of the flowchart shown in FIG. 11, this noise sensation Nr may be calculated.
  • FIG. 12 is a flowchart illustrating a procedure for calculating the shift amount using the first and second embodiments.
  • step S31 the process of the flowchart shown in FIG. 8 is executed. That is, the shift amounts dx1 and dy1 are calculated.
  • step S32 the process of the flowchart shown in FIG. 11 is executed. That is, the shift amounts dx2, dy2, and the noise feeling D are calculated.
  • step S33 the noise feeling D and the threshold value Nth are compared.
  • the noise sensation D represents the noise sensation of the combined image of the first image and the shifted second image.
  • shift amounts dx2 and dy2 are output in step S34.
  • the second image is shifted by the shift amounts dx2 and dy2, and a composite image of the first image and the shifted second image is generated.
  • the shift amounts dx1, dy1 are output in step S35. In this case, the second image is shifted by the shift amounts dx1, dy1, and a composite image of the first image and the shifted second image is generated.
  • image shift is performed so that a reduction in noise is realized.
  • image shift is performed so that the reduction of the motion region is realized (that is, the synthesized area is increased). That is, an image composition method is selected according to the property of the image. Therefore, the accuracy of camera shake correction is improved.
  • FIG. 13 is a flowchart showing another procedure for calculating the shift amount using the first and second embodiments. Steps S31 and S32 are as described with reference to FIG.
  • step S36 the weighting coefficient W is calculated based on the noise feeling D.
  • step S37 a converted image of the second image is generated based on the shift amounts dx1 and dy1 obtained in step S31, the shift amounts dx2 and dy2 obtained in step S32, and the weighting factor W obtained in step S36. Shift amounts dx and dy are calculated. The shift amounts dx and dy are calculated according to the following formula, for example.
  • the second image is shifted by the shift amount.
  • the second image is shifted by the shift amount.
  • the method according to the first and second embodiments is not limited to this procedure. That is, for example, the method of the first embodiment may calculate a shift amount that minimizes the motion region, and the second image may be shifted by the shift amount. Similarly, the method according to the second embodiment may calculate, for example, a shift amount that minimizes the feeling of noise, and shift the second image by the shift amount.
  • the image processing apparatus can generate a combined image using three or more images.
  • first to third images are input and the first image is a reference image.
  • image conversion by coordinate shift is performed for each of the second image and the third image.
  • the image synthesis unit 8 synthesizes the first image, the converted second image, and the converted third image. Or you may make it the image synthetic
  • the image processing apparatus shown in FIG. 6 or FIG. 9 can be realized by a hardware circuit.
  • some functions of the image processing apparatus may be realized by software.
  • one of the difference calculation unit 3, the motion region detection unit 4, the shift amount selection unit 5, the image shift unit 6, the shift amount determination unit 7, the image composition unit 8, the noise calculation unit 11, the shift amount determination unit 12, and the switch 13 may be realized by software.
  • FIG. 14 is a flowchart illustrating an image processing method according to another embodiment.
  • this image processing method first, a translational component of camera shake between the first and second images (left-right direction movement, up-down direction movement, sum of positional deviations caused by YAW and PITCH) is calculated. Then, the shift amount of the second image is calculated using the translation component of camera shake between images as an initial value.
  • step S41 the first and second images are acquired.
  • step S42 feature points of the first image are extracted.
  • step S43 feature point tracking is performed on the second image.
  • the shift amount between the first and second images is calculated.
  • the amount of shift between images is not particularly limited, but may be calculated by the following procedure, for example. (1)
  • the feature amount of each pixel is calculated.
  • the feature amount of each pixel is calculated by, for example, the KLT method or the Moravec operator.
  • one or more pixels having a feature amount larger than a predetermined threshold level are extracted as feature points. At this time, it is preferable that a plurality of feature points be extracted.
  • Each feature point extracted from the first image is searched for in the second image held in the image holding unit 2B.
  • the movement amount (motion vector) of the corresponding feature point is calculated between the first and second images.
  • the parallel movement amount (dx, dy), the rotation angle ( ⁇ ), and the enlargement / reduction ratio S of the positional deviation between the two images are calculated. Note that the translation amount is expressed in units of pixels.
  • step S44 the average of the amount of movement in the X direction of each feature point is set as the initial value of the variable dx. In addition, the average of the amount of movement in the Y direction of each feature point is set as the initial value of the variable dy.
  • step S45 coordinate shift is performed on the second image with dx and dy set in step S44.
  • step S46 a motion region (motion region A) between the first image and the coordinate-shifted second image is detected.
  • Steps S47 to S51 are basically the same as steps S14 to S18 shown in FIG. That is, the motion region B is detected, and the motion regions A and B are compared. When the motion area B becomes smaller than the motion area A, the shift amount selected at that time is output.
  • the processing amount for calculating the shift amount for reducing the motion region is reduced.
  • the selection range of the shift amount is “ ⁇ 12” to “+12”
  • the parallel movement component of the positional deviation between the images is “X direction: +9, Y direction: +6”.
  • the selection range of the shift amount dx can be “+6” to “+12”
  • the selection range of the shift amount dy can be “+3” to “+9”.
  • a converted image for image synthesis is generated only by shifting the coordinates of the second image.
  • the shift amount of the second image also includes a camera shake rotation component and an enlargement / reduction component. Therefore, the image quality of the composite image is improved as compared with the method in which only the translation component of the positional deviation between the images is compensated.
  • FIG. 14 is a flowchart illustrating an image processing method according to still another embodiment.
  • image processing is performed in consideration of the exposure time of the camera (image capturing unit 1).
  • the exposure time may be automatically determined by the camera or may be specified by the user.
  • step S61 the number of executions N is determined according to the exposure time of the image capturing unit 1.
  • the number of executions N is the number of executions of steps S65 to S68.
  • step S62 the first and second images are acquired.
  • step S63 the area dMin of the motion region between the first and second images is calculated.
  • the area of the motion region corresponds to, for example, the number of pixels in which the pixel value difference between the first and second images is larger than the threshold value. Note that dMin is used as a variable for searching for a smaller motion region in the following processing.
  • step S64 variables dx and dy for calculating the shift amount are initialized.
  • step S65 the second image is shifted by the shift amount selected by the shift amount selection unit 5 as in step S14 of FIG.
  • step S66 the area d 'of the motion region between the first image and the shifted second image is calculated.
  • step S67 the area dMin and the area d 'are compared.
  • step S68 If the area d 'is smaller than the area dMin, d' is substituted for dMin used as a variable in step S68. Further, the shift amounts dx and dy selected in step S65 are substituted into the variables dx1 and dy1. If the area d ′ is equal to or larger than the area dMin, step S68 is skipped.
  • step S69 it is checked whether or not the number of executions of steps S65 to S68 has reached “N”. “N” is determined according to the exposure time of the image capturing unit 1 in step S61. When the number of executions reaches “N”, the process of searching for an appropriate shift amount is terminated.
  • the shift amounts dx and dy that minimize the motion region are calculated within the number of executions determined according to the exposure time.
  • the exposure time is long, in general, the positional deviation between the first and second images becomes large. Therefore, when the exposure time is long, an appropriate shift amount can be obtained from a wide selection range by increasing the number of executions of steps S65 to S68.
  • the appropriate shift amount should be small. Therefore, an appropriate shift amount can be obtained even if the number of executions of steps S65 to S68 is reduced. Thereby, the calculation amount can be reduced.
  • the range for selecting the shift amount is determined in accordance with the positional deviation caused by the rotation of the camera or the forward / backward movement. For example, it is assumed that the number of pixels of an image to be shot is Height ⁇ Width, and the maximum value of the camera rotation angle assumed at the time of shooting is ⁇ . In this case, as shown in FIG. 16, the lateral shift amount for compensating for the rotation of the camera is in the range of “ ⁇ Height ⁇ sin ( ⁇ / 2)” to “+ Height ⁇ sin ( ⁇ / 2)”. To do.
  • the vertical shift amount for compensating for the rotation of the camera exists in the range of “ ⁇ Width ⁇ sin ( ⁇ / 2)” to “+ Width ⁇ sin ( ⁇ / 2)”. Therefore, when the first image and the second image are combined, if the second image is converted with the shift amount selected within the above range, the amount of calculation is reduced. Note that the method of reducing the amount of calculation by limiting the selection range of the shift amount is also effective when compensating for a shift component caused by the movement of the camera in the front-rear direction.
  • a method for calculating the shift amount within a limited range according to the rotation of the camera or the movement in the front-rear direction will be described with reference to FIG.
  • step S71 the first and second images are acquired.
  • step S72 a shift amount selection range is designated.
  • the range of the horizontal shift amount is ⁇ dx0 to + dx0
  • the range of the vertical shift amount is ⁇ dy0 to + dy0.
  • step S73 the area dMin of the motion region between the first and second images is calculated.
  • dMin is used as a variable for searching for the minimum motion region in the following processing.
  • step S74 a variable for calculating the shift amount is initialized. As the initial value, the minimum value of each range is given.
  • steps S75 to S78 is basically the same as steps S65 to S68 shown in FIG. However, here, calculation is performed on dx in a state where dy is fixed. That is, the second image is shifted by the selected shift amount, the area d ′ of the motion region between the first image and the shifted second image is calculated, and the area dMin and the area d ′ are compared. Is done. If the area d ′ is smaller than the area dMin, d ′ is substituted for the variable dMin. Further, the shift amount dx selected in step S75 is substituted into the variable dx1. If the area d ′ is equal to or larger than the area dMin, step S68 is skipped.
  • Step S79 is provided for scanning the horizontal shift amount from “ ⁇ dx” to “+ dx” with the vertical shift amount fixed.
  • Steps S80 and S81 are provided for scanning the vertical shift amount from “ ⁇ dy” to “+ dy” with the horizontal shift amount fixed.
  • the shift amount that minimizes the motion region within the range set as the initial value is calculated.
  • the second image is converted by the shift amount, and a composite image of the first image and the converted second image is generated. Therefore, when generating a composite image, the area of the region to be combined is maximized, and noise is minimized.
  • the methods shown in FIGS. 14 and 17 can be executed in combination.
  • the initial value of the shift amount dx, dy is set based on the translational component of the displacement between images caused by camera shake, and the shift amount selection range is set according to the maximum value of the camera rotation angle. You may make it set.
  • the shift amount for reducing the motion region is calculated, but in any embodiment, the shift is performed so as to reduce the noise feeling. An amount may be calculated.
  • ⁇ Other embodiment 4> In an image processing method in which camera shake is corrected by combining a plurality of images, image quality is likely to deteriorate in a region with many motion regions or a region with a strong sense of noise. For this reason, in this embodiment, first, a region with a large motion region or a region with a strong noise feeling is extracted as a region of interest. Then, the processes of the flowcharts shown in FIGS. 8, 11 to 15, and 17 are executed for the attention area. According to this method, a high-quality composite image can be created with a small amount of calculation.
  • the attention area is determined by, for example, dividing the image into a plurality of blocks and calculating the area of the movement area or the noise feeling in each block.
  • FIG. 18A the image is divided into an upper block and a lower block.
  • FIG. 18B the image is divided into a right block and a left block.
  • FIG. 18C the image is divided into four blocks.
  • the block having the largest area of the motion region or the block having the strongest noise feeling is selected as the attention region.
  • a block in which the area of the motion area or the noise sensation exceeds the threshold level may be selected as the attention area.
  • One shift amount may be calculated for one image, or the shift amount may be calculated for each block.
  • a composite image may be generated by the following procedure. (1) Specify a region where the difference in pixel value between the first and second images is greater than a threshold value. (2) A motion vector between the first and second images is calculated for the pixels in the specified region. (3) A converted image is generated by shifting the coordinates of each pixel of the second image according to the calculated motion vector. (4) A synthesized image is generated by synthesizing the first image and the converted image.
  • the noise parameter is detected based on the first and second images.
  • the noise parameter corresponds to, for example, the area of the motion region between the first and second images in the first embodiment.
  • the noise parameter corresponds to a noise feeling.
  • a shift amount for reducing the noise parameter is calculated.
  • the process for reducing the noise parameter can be selected from at least the following three algorithms. (1) Calculation when the noise parameter of the composite image of the first image and the converted second image becomes smaller than the noise parameter when the first and second images are combined as they are (2) Minimize the noise parameter (3) Minimize the noise parameter within a predetermined number of calculations Further, the image processing method of each embodiment is not limited to camera shake correction, but other image synthesis techniques It is also applicable to. For example, the method of each embodiment can be applied to mosaicing processing.
  • FIG. 19 is a diagram illustrating a hardware configuration of an image processing apparatus (or a computer that executes an image processing method) according to each embodiment.
  • the CPU 101 executes an image processing program using the memory 103.
  • the storage device 102 stores an image processing program. Note that the storage device 102 may be an external recording device.
  • the memory 103 is a semiconductor memory, for example, and includes a RAM area and a ROM area.
  • the reading device 104 accesses the portable recording medium 105 in accordance with an instruction from the CPU 101.
  • the portable recording medium 105 includes, for example, a semiconductor device (PC card or the like), a medium to / from which information is input / output by a magnetic action, and a medium to / from which information is input / output by an optical action.
  • the communication interface 106 transmits / receives data via a network in accordance with instructions from the CPU 101.
  • the input / output device 107 corresponds to a camera, a display device, a device that receives an instruction from a user, or the like.
  • the image processing program according to the embodiment is provided in the following form, for example. (1) Installed in advance in the storage device 102. (2) Provided by the portable recording medium 105. (3) Download from the program server 110.
  • the image processing apparatus according to the embodiment is realized by executing the image processing program on the computer having the above configuration.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Studio Devices (AREA)
  • Image Analysis (AREA)

Abstract

 連続撮影により得られる複数の画像の中の第1および第2の画像から合成画像を生成する画像処理方法において、前記第1および第2の画像に基づいてノイズパラメータを検出し、前記ノイズパラメータを小さくするシフト量を算出し、前記シフト量に従って前記第2の画像の各画素の座標をシフトすることにより変換画像を生成し、前記第1の画像および前記変換画像を合成して合成画像を生成する。

Description

画像処理方法および画像処理装置
 本発明は、デジタル画像を処理する方法および装置に係わり、例えば、複数の画像を利用して電子カメラの手ぶれを補正する方法に適用可能である。
 近年、手ぶれ補正機能を備えた電子カメラが実用化されている。手ぶれ補正機能は、光学技術または画像処理技術により実現される。そして、手ぶれ幅は、露光時間を短くすることにより小さくすることができる。しかし、露光時間が短くなると、光量が不足するので、画像上のノイズが大きくなってしまう。そこで、画像処理による手ぶれ補正は、露光時間を短くすると共に、例えば、連続撮影により得られる複数の画像を、位置合わせをした後に合成することで実現される。
 手ぶれは、撮影時にカメラが動くことにより発生する。ここで、カメラの動きは、図1に示す6つの要素により定義される。
(1)YAW
(2)PITCH
(3)左右平行移動
(4)上下平行移動
(5)ROLL
(6)前後平行移動
 ただし、カメラがYAW方向にぶれたときは、画像は、近似的に水平方向にずれることになる。また、カメラがPITCH方向にぶれたときは、画像は、近似的に垂直方向にずれることになる。したがって、カメラの動き要素と画像のずれ成分との関係は、図2に示すようになる。
 手ぶれ補正処理では、例えば、連続撮影により得られる2枚の画像(第1および第2の画像)の間でのぶれ量が検出され、そのぶれ量を補償するように第2の画像が変換(例えば、アフィン変換)される。すなわち、位置合わせが行われる。そして、第1の画像および変換後の第2の画像を合成することにより、手ぶれが補正された画像が得られる。
 アフィン変換では、元画像の各画素の座標が下記(1)式に従って変換される。
Figure JPOXMLDOC01-appb-M000001
ここで、「dx」は水平方向ずれ量であり、「dy」は垂直方向ずれ量である。「θ」はカメラのROLL方向のずれの回転角である。「S」は、カメラが遠近方向に動くことにより発生する拡大/縮小率である。(x,y)は変換前の画像の座標であり、(x’,y’)は変換後の画像の座標である。アフィン変換による画像変換の例を図3に示す。図3に示す例では、画像は、アフィン変換により、平行移動すると共に、時計方向に回転している。
 しかし、アフィン変換では、変換前の画像の各画素および変換後の画像の各画素が1対1に対応するわけではない。すなわち、変換後の画像の各画素は、一般に、変換前の画像の複数の画素により表される。例えば、図4に示す例では、変換後の画像の画素Eは、変換前の画像の4つの画素A~Dにより表される。
 ここで、変換後の画素Eの画素値として、例えば、画素A~Dの中の1つ(例えば、画素C)の画素値を使用することができる。しかし、この方法では、画像の輪郭線にジャギーが発生するおそれがある。
 この問題を解決するためには、例えば、周辺の画素の画素値を利用して補間を行う方法が知られている。ここで、画素値を線形補間することにより変換後の画像が再生される場合、画素Eの画素値Pは、下式で計算される。
P=Sa・Pa+Sb・Pb+Sc・Pc+Sd・Pd
Pa~Pdは、画素A~Dの画素値
Sa~Sdは、画素Eが画素A~D上に占める面積
 なお、関連する技術として、下記の画像処理装置が提案されている。すなわち、基準画像と比較画像の多重解像度画像を作成する。解像度の低い画像に対しては、全範囲マッチングを行って、画像間の2次元のずれを検出する。解像度の比較的高い画像に対しては、ブロックマッチングによって、ブロックごとのずれを検出する。最低解像度から順に高解像度に対して、前段階で求めた動きデータを初期値として用いて、その動きデータをより高解像度の画像によって補正することにより、精度の高いものにしていく。(例えば、特許文献1)
 また、他の関連する技術として、特許文献2~4に記載の画像処理方法が提案されている。
特開2007-226643号公報 特開2000-298300号公報 特開2004-234623号公報 特開2001-223932号公報
 しかし、アフィン変換では、回転または拡大/縮小による位置ずれを補正するために、全画素に対して複雑な行列演算を行う必要がある。すなわち、アフィン変換は、計算量が多い。また、アフィン変換を行うと、変換後の画像の各画素値がその周辺の画素値を利用して補間される場合、画像がぼけることがある。この場合、合成画像の画質も劣化してしまう。
 本発明の課題は、複数の画像を利用して合成画像を生成する処理の演算量を少なくすることである。
 本発明の1つの態様に係る画像処理方法は、連続撮影により得られる複数の画像の中の第1および第2の画像から合成画像を生成する方法であって、前記第1および第2の画像に基づいてノイズパラメータを検出し、前記ノイズパラメータを小さくするシフト量を算出し、前記シフト量に従って前記第2の画像の各画素の座標をシフトすることにより変換画像を生成し、前記第1の画像および前記変換画像を合成して合成画像を生成する。
 開示の装置または方法によれば、複数の画像を利用して合成画像を生成する処理の演算量が少なくなる。
カメラの動き要素について説明する図である。 カメラの動き要素と画像のずれ成分との関係をまとめた表である。 アフィン変換による画像変換の例を示す図である。 画素値の線形補間について説明する図である。 手ぶれ補正処理の一例を示すフローチャートである。 第1の実施形態の画像処理装置の構成を示す図である。 第1の実施形態の画像合成方法の概要を説明する図である。 第1の実施形態においてシフト量を算出する手順を示すフローチャートである。 第2の実施形態の画像処理装置の構成を示す図である。 合成画像のノイズ成分を抽出する方法を説明する図である。 スムージングフィルタの実施例である。 第2の実施形態においてシフト量を算出する手順を示すフローチャートである。 第1および第2の実施形態を利用してシフト量を算出する手順を示すフローチャート(その1)である。 第1および第2の実施形態を利用してシフト量を算出する手順を示すフローチャート(その2)である。 他の実施形態の画像処理方法を示すフローチャート(その1)である。 他の実施形態の画像処理方法を示すフローチャート(その2)である。 回転成分に応じたシフト量の選択範囲について説明する図である。 他の実施形態の画像処理方法を示すフローチャート(その3)である。 画像分割の実施例である。 画像処理装置のハードウェア構成を示す図である。
 デジタルカメラ(または、電子カメラ)は、手ぶれの影響を抑えるための機能が要求されることがある。ここで、画像撮影のための露光時間を短くすれば、手ぶれの影響は抑制される。しかし、露光時間が短いと、画像にノイズが生じる。このため、電子的手ぶれ補正では、一般に、ランダムなノイズを抑制するために、連写撮影により得られる複数の画像が合成される。そして、短時間露光撮影と画像合成により、手ぶれの影響が少なく、かつ、ノイズが抑制された、手ぶれ補正画像を得ることができる。
 図5は、手ぶれ補正処理の一例を示すフローチャートである。ここでは、連写撮影により得られる2枚の画像を利用して手ぶれが補正されるものとする。
 ステップS1では、通常よりも露光時間の短い連写撮影により2枚の画像(第1の画像および第2の画像)が生成される。ステップS2では、第1の画像に対する第2の画像のずれ量が算出される。ステップS3では、算出されたずれ量を補正するように、第2の画像が変換される。そして、ステップS4において、第1の画像と変換された第2の画像とが合成される。これにより、手ぶれ補正画像が生成される。
 ここで、従来の技術によれば、図5のステップS3において、例えばアフィン変換が行われていた。しかし、上述したように、アフィン変換は演算量が多い。これに対して、実施形態の画像処理方法では、図5のステップS3において、第2の画像は、単に平行移動される。画像の平行移動は、各画素の座標をシフトするだけで実現されるので、演算量が少ない。以下、実施形態の画像処理装置および画像処理方法について説明する。なお、実施形態の画像処理方法では、図5のステップS2は必須の手順ではない。
 図6は、第1の実施形態の画像処理装置の構成を示す図である。この画像処理装置は、特に限定されるものではないが、例えば、デジタルカメラ(または、電子カメラ)に搭載される。
 画像撮影部1は、例えば、CCDイメージセンサまたはCMOSイメージセンサを含んで構成され、デジタル画像を生成する。なお、画像撮影部1は、連写撮影機能を備えている。この実施例では、画像撮影部1は、1回のシャッタ押圧操作により、短い時間内に撮影される複数の画像(第1の画像および第2の画像)を得ることができる。
 画像保持部2A、2Bは、それぞれ、画像撮影部1により得られる第1の画像および第2の画像を保持する。画像保持部2A、2Bは、例えば、半導体メモリである。ここで、第1および第2の画像は、連写撮影により得られた複数の画像の中の任意の2つの画像である。また、第1の画像は、第2の画像よりも先に撮影された画像であってもよいし、第2の画像よりも後に撮影された画像であってもよい。なお、第2の画像が画像シフト部6により変換されたときは、その変換された第2の画像(変換画像)も画像保持部2Bに保持される。
 差分算出部3は、画像保持部2A、2Bにより保持されている1組の画像の差分を算出する。すなわち、差分画像が生成される。このとき、1組の画像の各画素についてそれぞれ画素値の差分が算出される。画素値は、一般に、輝度データおよび色データを含むが、この実施例では、例えば、各画素の輝度データの差分が算出される。
 動き領域検出部4は、差分算出部3の演算結果を参照し、画像間の画素値の差分が予め決められた閾値よりも大きい画素を検出する。以下の説明では、画素値の差分が予め決められた閾値よりも大きい領域を「動き領域」と呼ぶことがある。動き領域は、例えば、撮影時の手ぶれによって発生する。ただし、手ぶれが生じたとしても、同じ画素値が一様に広がっている領域(例えば、風景画像の青空が広がっている領域など)は、画像間で対応する画素の画素値は変化しないので、動き領域にはならない。
 シフト量選択部5は、第2の画像を変換するためのシフト量(X方向移動量およびY方向移動量)を選択する。ここで、シフト量は、予め決められた範囲内から選択されるようにしてもよい。また、シフト量は、画素を単位として表される。すなわち、シフト量は、水平方向および垂直方向のシフト量を指示する整数(ゼロ、負の値を含む)により表される。
 画像シフト部6は、シフト量選択部5により選択されたシフト量に従って、画像保持部2Bに保持されている第2の画像の各画素を、水平方向および/または垂直方向にシフトさせる。このシフト処理は、例えば、各画素のアドレスおよび画素値が対応づけられている画像データにおいて、各画素のアドレスを同じ量だけシフトすることによって実現される。例えば、選択されたシフト量が「dx=10、dy=5」であれば、画像シフト部6は、第2の画像の各画素の座標(アドレス)を、X方向に10画素分だけシフトさせると共に、Y方向に5画素分だけシフトさせる。
 差分算出部3、動き領域検出部4、シフト量選択部5、画像シフト部6は、後で詳しく説明するが、シフト量を変えながら対応する動き領域を検出する。このとき、シフト量決定部7は、動き領域検出部4により検出される動き領域が所定の条件を満たすシフト量を決定する。そして、シフト量決定部7は、動き領域が所定の条件を満たしたときに、画像合成指示を出力する。
 画像合成部8は、シフト量決定部7から画像合成指示を受信すると、画像保持部2A、2Bに保持されている1組の画像を合成する。このとき、画像保持部2Aには、第1の画像が保持されている。また、画像保持部2Bには、動き領域が所定の条件を満たすようにシフトされた第2の画像が保持されている。すなわち、第1の画像および第2の画像の変換画像が合成される。
 なお、上記1組の画像の各画素値(輝度データ、色データを含む)を互いに足し合わせると、合成画像においては、動き領域の像は2重に写ってしまう。すなわち、像がぶれてしまう。このため、画像合成部8は、動き領域については、画素値の足し算を行うことなく、1組の画像のうちの一方(例えば、第1の画像)の画素値を出力する。
 図7は、第1の実施形態の画像合成方法の概要を説明する図である。なお、図7(a)は、連写撮影により得られた第1の画像または第2の画像のいずれか一方であるものとする。
 図7(b)は、手ぶれに起因する第1、第2の画像間の位置ずれを表す図である。手ぶれは、図1に示すように、6つの要素に起因して発生する。ここで、左右平行移動および上下平行移動に起因する位置ずれは、画像上のすべての座標において同じである。また、YAWおよびPITCHに起因する位置ずれは、近似的に、画像上のすべての座標において同じである。よって、これら4つの要素に起因する位置ずれは、画像上のすべての座標においてほぼ同じである。すなわち、図7(b)において、第1、第2の画像間での画素P1~P4の位置ずれの平行移動成分(左右方向移動、上下方向移動、YAW、PITCHに起因する位置ずれの和)を表す並進ベクトルT1~T4は、互いにほぼ同じである。
 これに対して、ROLLに起因して発生する手ぶれの成分(回転成分)は、画像内の座標により異なる。すなわち、画素P1~P4の手ぶれの回転成分を表す回転ベクトルR1~R4は、互いに異なっている。図7(b)に示す例では、画素P1が右方向に移動し、画素P2が下方向に移動し、画素P3が左方向に移動し、画素P4が上方向に移動している。なお、前後平行移動に起因する位置ずれも、ROLLに起因する位置ずれと同様に、画像内の座標により異なる。ただし、一般に、前後平行移動に起因する位置ずれは、ROLLに起因する位置ずれと比較して小さい。よって、ここでは、前後平行移動に起因する位置ずれは無視するものとする。そうすると、画素P1~P4の位置ずれを表すベクトルS1~S4は、それぞれ、並進ベクトルT1~T4と回転ベクトルR1~R4との和である。
 実施形態の画像処理方法では、第1および第2の画像を合成するための位置合わせ処理を簡単にするために、画像の平行移動によって位置合わせが実現される。ここで、位置合わせ処理は、例えば、図7(b)に示す並進ベクトルT1~T4を補償する平行移動処理が考えられる。
 図7(c)は、第1の画像と並進ベクトルT1~T4が補償された第2の画像との差分画像を示している。図7(c)では、これらの1組の画像間での画素値の差分が閾値よりも大きい領域(すなわち、動き領域)が黒色で表されている。この場合、回転成分が補償されていないので、動き領域が大きい。
 ここで、上記1組の画像を合成すると、合成画像において、動き領域の像は2重に写ってしまう。すなわち、像がぶれてしまう。このため、上述したように、画像合成部8は、動き領域については、画素値の足し算を行うことなく、1組の画像のうちの一方(たとえば、第1の画像)の画素値を出力する。ただし、一方の画像のみが使用される領域では、画像合成によるノイズ低減効果が得られないので、画質が劣化する(画質を向上させられない)おそれがある。このため、画像合成処理においては、動き領域が少ないことが好ましい。
 第1の実施形態の画像処理方法では、動き領域が小さくなるように第2の画像がシフトされ、第1の画像とシフト後の第2の画像とが合成される。ここで、一般に、動き領域が画像全体に均一に分布していることは稀である。例えば、図7(c)に示す例では、画像内の下部領域に動き領域が多く存在している。この場合、画像内の下部領域で発生する画素の位置ずれを補償するように、第2の画像のシフト量が決定される。図7(b)に示す例では、画素P3の手ぶれベクトルS3を補償するように、第2の画像全体に対してシフト処理が行われる。
 図7(d)は、第1の画像と、下部領域の位置ずれを補償するようにシフト処理が行われた第2の画像との差分画像を示している。この差分画像では、図7(c)に示す例と比較して、動き領域(黒色で表されている領域)が小さくなっている。このため、画像が合成される領域が大きくなり、合成画像のノイズが少なくなる。なお、図7(d)に示すように、下部領域の位置ずれを補償するようにシフト処理が行われると、上部領域のずれ量は大きくなることがある。しかし、上部領域は、この例では、動き領域が少ない。すなわち、上部領域は、画素値の変化が小さい領域である。このため、第1、第2の画像間での位置ずれが大きくても、合成画像において画質の劣化は認識されにくい。したがって、第1の実施形態の方法により得られる合成画像は、全体として、認識されるノイズが少なくなる。
 図8は、第1の実施形態においてシフト量を算出する手順を示すフローチャートである。ここで、シフト量dx、dyは、各画素の座標のシフト量であり、いずれも整数である。なお、シフト処理(平行移動)による座標変換は、下記(2)式で表される。
Figure JPOXMLDOC01-appb-M000002
「dx」は水平方向シフト量であり、「dy」は垂直方向シフト量である。(x,y)は、変換前の画像の座標であり、(x’,y’)は、変換後の画像の座標である。ただし、第1の実施形態では、(2)式に示す行列演算を行う必要はなく、例えば、各画素のアドレスおよび画素値が対応づけられている画像データにおいて、各画素のアドレスをシフトすることにより実現される。
 ステップS11において、画像撮影部1は、連写撮影により、2枚の画像(第1および第2の画像)を取得する。なお、第1および第2の画像は、それぞれ、画像保持部2A、2Bに保持される。
 ステップS12において、差分算出部3は、第1の画像と第2の画像との差分画像を生成する。そして、動き領域検出部4は、この差分画像において動き領域を検出する。動き領域は、上述したように、画像間の画素値の差分の絶対値が閾値よりも大きい領域である。なお、ステップS12で得られる動き領域は、画像変換が行われる前の1組の画像から得られる初期動き領域であり、以下の説明では、「動き領域A」と呼ぶことにする。
 ステップS13において、シフト量選択部5は、シフト量(平行移動量)を計算するための変数dx、dyを初期化する。続いて、ステップS14において、画像シフト部6は、シフト量選択部5により選択されたシフト量dx、dyだけ、第2の画像の各画素の座標をシフトさせる。すなわち、第2の画像に対して平行移動が実行される。そして、座標シフトが行われた第2の画像は、画像保持部2Bに書き込まれる。
 シフト量選択部5は、予め決められたアルゴリズムに従って、シフト量dx、dyを選択するようにしてもよい。このとき、シフト量選択部5は、ステップS14~S17が繰り返し実行される毎に、順番に、異なるシフト量dx、dyを出力する。下記に順番に選択されるシフト量の一例を示す。
(dx、dy)=「0,3」→「0,6」→「0,9」→「0,12」→「0,-3」→「0,-6」→「0,-9」→「0,-12」→「3,0」→「3,3」→「3,6」→「3,9」→「3,12」→「3,-3」→「3,-6」→「3,-9」→「3,-12」...「-12,-12」
 この例では、dxおよびdyは、それぞれ「-12から+12」の範囲から選択される。また、ステップサイズΔdx、Δdyは、それぞれ「3」である。なお、上記範囲およびステップサイズは、例えば、画像のサイズ(すなわち、画素数)に応じて決定されるようにしてもよい。
 ステップS15において、差分算出部3は、第1の画像と座標シフトが行われた第2の画像との差分画像を生成する。そして、動き領域検出部4は、この差分画像において動き領域を検出する。なお、以下の説明では、ステップS15で得られる動き領域を「動き領域B」と呼ぶことにする。
 ステップS16において、シフト量決定部7は、動き領域Aおよび動き領域Bの面積を比較する。動き領域Bの面積が動き領域Aの面積よりも大きいときは、ステップS17において、ステップS14~S16の実行回数が所定値に達したか否かがチェックされる。そして、ステップS14~S16の実行回数が所定値に達していなければ、ステップS14に戻る。
 動き領域Bの面積が動き領域Aの面積よりも小さければ、シフト量決定部7は、そのときにシフト量選択部5より選択されているシフト量dx、dyを保持する。すなわち、シフト量dx、dyが決定される。ここで、動き領域Bが動き領域Aよりも小さい状態は、第2の画像をシフトさせることにより、新たな動き領域が初期動き領域よりも小さくなったことを意味する。このように、第1の実施形態の方法では、動き領域を小さくするように、第2の画像のシフト量が決定される。なお、以下の説明では、第1の実施形態の画像処理方法で得られるシフト量を「dx1、dy1」と呼ぶことがある。
 シフト量決定部7は、シフト量dx、dyを決定すると、画像合成指示を出力する。そして、画像合成部8は、画像合成指示を受信すると、画像保持部2A、2Bに保持されている1組の画像を合成する。このとき、画像保持部2Aには、第1の画像が保持されている。また、画像保持部2Bには、ステップS11~18において算出されたシフト量dx、dyだけシフトされた第2の画像が保持されている。すなわち、第1の画像およびシフトされた第2の画像が合成される。
 このように、第1の実施形態の画像処理方法においては、第1および第2の画像間の動き領域が小さくなるように第2に画像が変換され、第1の画像および変換された第2の画像が合成される。このとき、第2の画像の変換は、各画素の座標を画素単位でシフトするだけで実現される。したがって、少ない演算量で画像合成が実現され、手ぶれが補正される。
 なお、合成画像のノイズは、上述したように、第1および第2の画像間の動き領域の大きさに依存する。すなわち、動き領域の大きさは、合成画像のノイズを表す指標である。したがって、図6に示す差分算出部3および動き領域検出部4は、ノイズパラメータを検出するノイズパラメータ検出部として動作する。また、シフト量選択部5およびシフト量決定部7は、ノイズパラメータ検出部により検出されたノイズパラメータを小さくするようにシフト量を算出するシフト量算出部として動作する。
 図9は、第2の実施形態の画像処理装置の構成を示す図である。第2の実施形態の画像処理装置において、画像撮影部1、画像保持部2A、2B、シフト量選択部5、画像シフト部6、画像合成部8は、基本的に、第1の実施形態と同じである。
 ノイズ算出部11は、画像合成部8により生成される合成画像のノイズ感を算出する。ノイズ感は、合成画像のノイズ成分を抽出することにより算出される。ノイズ成分は、下式により算出される。
ノイズ成分=元画像-元画像のぼかし画像
 ノイズ感は、例えば、各画素について算出されるノイズ成分の総和である。この場合、ノイズ感が高い状態は、元画像と元画像のぼかし画像との差分(すなわち、ノイズ成分)が大きく、ノイズ成分の総和が大きい状態に相当する。また、ノイズ間が低い状態は、元画像と元画像のぼかし画像との差分(すなわち、ノイズ成分)が小さく、ノイズ成分の総和が小さい状態に相当する。ただし、ノイズ感は、この例に限定されるものではなく、他のパラメータで表されてもよい。
 図10Aは、合成画像のノイズ成分を抽出する方法を説明する図である。図10Aに示すように、ぼかし画像は、合成画像に対してスムージングフィルタ演算を実行することにより生成される。スムージングフィルタは、例えば、図10Bに示す演算により実現される。さらに、元画像とスムージングフィルタ演算を施した後のぼかし画像との間で各画素値の差分が計算される。そして、合成画像のノイズ成分は、各画素値の差分の絶対値の総和を計算することにより得られる。
 シフト量決定部12は、ノイズ算出部11により算出されるノイズ感が所定の条件を満たすシフト量を決定する。そして、シフト量決定部12は、ノイズ感が所定の条件を満たしたときに、画像合成指示を出力する。
 スイッチ13は、シフト量決定部12から画像合成指示を受信すると、画像合成部8により生成された合成画像を出力する。すなわち、合成画像のノイズ感が所定の条件を満たしたときに、その合成画像が出力される。
 図11は、第2の実施形態においてシフト量を算出する手順を示すフローチャートである。第2の実施形態においても、シフト量dx、dyが算出される。また、第2の実施形態の手順は、基本的には、第1の実施形態と同じである。ただし、第1の実施形態では動き領域の面積に基づいてシフト量が算出されたが、第2の実施形態ではノイズ感に基づいてシフト量が算出される。
 ステップS21において、画像撮影部1は、連写撮影により2枚の画像(第1および第2の画像)を取得する。ステップS22において、ノイズ算出部11は、第1および第2の画像の合成画像のノイズ感を算出する。なお、以下の説明では、ステップS22で得られるノイズ感のことを「ノイズ感C」と呼ぶことにする。
 ステップS23、S24は、第1の実施形態のステップS13、S14と同じである。すなわち、ステップS23では、シフト量dx、dyが初期化される。また、ステップS24では、シフト量選択部5により選択されたシフト量dx、dyだけ、第2の画像に対して座標シフトが実行される。このとき、画像合成部8は、第1の画像と座標シフトが行われた第2の画像との合成画像を生成する。
 ステップS25において、新たに生成された合成画像のノイズ感を算出する。なお、以下の説明では、ステップS25で得られるノイズ感を「ノイズ感D」と呼ぶことにする。
 ステップS26において、シフト量決定部12は、ノイズ感Cおよびノイズ感Dを比較する。そして、ノイズ感Dがノイズ感Cよりも多ければ、ステップS27において、ステップS24~S26の実行回数が所定値に達したか否かがチェックされる。そして、ステップS24~S26の実行回数が所定値に達していなければ、ステップS24に戻る。
 ノイズ感Dがノイズ感Cよりも少なければ、シフト量決定部12は、そのときシフト量選択部5より選択されているシフト量dx、dyを保持する。すなわち、第2の画像を変換するためのシフト量dx、dyが決定される。ここで、ノイズ感Dがノイズ感Cよりも少ない状態は、第2の画像を平行移動することにより、合成画像のノイズが低減したことを意味する。このように、第2の実施形態の方法においては、ノイズ感を少なくするように、第2の画像のシフト量が決定される。なお、以下の説明では、第2の実施形態の画像処理方法で得られるシフト量を「dx2、dy2」と呼ぶことがある。
 シフト量決定部12は、シフト量dx、dyを決定すると、画像合成指示を出力する。そうすると、スイッチ13は、画像合成部8により生成された合成画像を出力する。このとき、画像合成部8は、ノイズ感が少ない合成画像を生成している。したがって、ノイズ感が少ない合成画像が生成されることになる。
 このように、第2の実施形態の画像処理方法においては、第1および第2の画像の合成画像のノイズ感が少なくなるように第2の画像が変換され、第1画像および変換された第2の画像が合成される。このとき、第2の画像の変換は、各画素の座標をシフトするだけで実現される。したがって、少ない演算量で画像合成が実現され、手ぶれが補正される。
 なお、上記構成の画像処理装置において、ノイズ算出部11は、ノイズパラメータを検出するノイズパラメータ検出部として動作する。また、シフト量選択部5およびシフト量決定部12は、ノイズパラメータ検出部により検出されたノイズパラメータ(第2の実施形態では、ノイズ感)を小さくするようにシフト量を算出するシフト量算出部として動作する。
 ところで、画像のノイズは、画像内の画素値の変動が大きい領域よりも、画素値の変動が緩やかな領域の方が目立つ、という性質を有する。この性質は、画素値の変動が大きいと、ノイズが画素値の変動に埋もれ、人間の目がノイズの濃淡を判別しにくくなるためである。したがって、ぼかし画像の階調変動が大きい領域(元画像の画素値変動が大きい領域)の重みを小さくし、階調変動の小さい領域の重みを大きくすることで、下式により画像のノイズ感Nrを数値化することができる。
ノイズ感Nr=ΣΣkx,y ×w[s]
x:画像内の水平方向座標
y:画像内の垂直方向座標
x,y :座標(x,y)の動き領域判定結果(1:動き領域、0:非動き領域)
w[s] :階調変動sに対する重み係数(例えば、w[0]=1、w[1]=2)
ここで、階調変動sは、この実施例では、パラメータJが閾値よりも大きいときに「1」であり、パラメータJが閾値以下のときに「0」である。
J=abs{Y(x,y-1)-Y(x,y)}+abs{Y(x-1,y)-Y(x,y)}+abs{Y(x+1,y)-Y(x,y)}+abs{Y(x,y+1)-Y(x,y)}
ここで、「abs{}」は、絶対値を算出する関数である。また、「Y(i,j)」は、ぼかし画像の座標(i,j)における輝度値である。
 上記演算によれば、非動き領域は、kx,y がゼロなので、各画素のノイズ指標もゼロである。一方、動き領域のノイズ指標は、階調変動sに依存する。すなわち、階調変動sが閾値Nthよりも大きい領域に属する画素のノイズ指標は「1」であり、階調変動sが閾値Nth以下の領域に属する画素のノイズ指標は「2」である。そして、ノイズ感Nrは、各画素のノイズ指標の総和を計算することにより得られる。図11に示すフローチャートのステップS22およびS25では、このノイズ感Nrを算出するようにしてもよい。
 図12は、第1および第2の実施形態を利用してシフト量を算出する手順を示すフローチャートである。
 ステップS31では、図8に示すフローチャートの処理が実行される。すなわち、シフト量dx1、dy1が算出される。ステップS32では、図11に示すフローチャートの処理が実行される。すなわち、シフト量dx2、dy2、およびノイズ感Dが算出される。
 ステップS33においては、ノイズ感Dおよび閾値Nthが比較される。ここで、ノイズ感Dは、第1の画像とシフトされた第2の画像との合成画像のノイズ感を表す。そして、ノイズ感Dが閾値Nthよりも多いときは、ステップS34において、シフト量dx2、dy2が出力される。この場合、第2の画像はシフト量dx2、dy2だけシフトされ、第1の画像とシフトされた第2の画像との合成画像が生成される。一方、ノイズ感Dが閾値Nth以下であれば、ステップS35において、シフト量dx1、dy1が出力される。この場合、第2の画像はシフト量dx1、dy1だけシフトされ、第1の画像とシフトされた第2の画像との合成画像が生成される。
 上記手順によれば、ノイズ感が多い画像においては、ノイズ感の低減が実現されるように画像シフトが行われる。また、ノイズ感が少ない画像では、動き領域の低減が実現されるように(すなわち、合成される面積が大きくなるように)画像シフトが行われる。すなわち、画像の性質に応じて画像合成方法が選択される。したがって、手ぶれ補正の精度が向上する。
 図13は、第1および第2の実施形態を利用してシフト量を算出する他の手順を示すフローチャートである。なお、ステップS31、S32は、図12を参照しながら説明した通りである。
 ステップS36では、ノイズ感Dに基づいて重み係数Wが算出される。重み係数Wは、例えば、下記のように決定される。
(1)ノイズ感Nrが閾値Nthよりも大きいときは、W=1
(2)ノイズ感Nrが閾値Nth以下であるときは、W=Nr/Nth
 そして、ステップS37において、ステップS31で得られるシフト量dx1、dy1、ステップS32で得られるシフト量dx2、dy2、およびステップS36で得られる重み係数Wに基づいて、第2の画像の変換画像を生成するためのシフト量dx、dyを算出する。シフト量dx、dyの算出は、例えば、下式に従う。
dx=dx1×(1-W)+dx2×W
dy=dy1×(1-W)+dy2×W
 このように、図13に示す手順では、ノイズ感が少ないときには、動き領域およびノイズ感の双方に基づいて、第2の画像のシフト量が決定される。すなわち、この手順によっても、画像の性質に応じて画像合成方法が選択される。したがって、手ぶれ補正の精度が向上する。
 なお、図8に示すフローチャートでは、動き領域を小さくするシフト量が算出されたときに、そのシフト量で第2の画像がシフトされる。また、図11に示すフローチャートでは、ノイズ感を少なくするシフト量が算出されたときに、そのシフト量で第2の画像がシフトされる。しかし、第1および第2の実施形態に係る方法は、この手順に限定されるものではない。すなわち、第1の実施形態の方法は、例えば、動き領域を最小化するシフト量を算出し、そのシフト量で第2の画像がシフトされるようにしてもよい。同様に、第2の実施形態の方法は、例えば、ノイズ感を最小化するシフト量を算出し、そのシフト量で第2の画像がシフトされるようにしてもよい。
 また、上述の実施例では、2枚の入力画像が合成されているが、実施形態の画像処理装置は、3枚以上の画像を利用して合成画像を生成することもできる。例えば、第1~第3の画像が入力され、第1の画像が基準画像であるものとする。この場合、第2の画像および第3の画像それぞれについて座標シフトによる画像変換が行われる。そして、画像合成部8は、第1の画像、変換後の第2の画像、変換後の第3の画像を合成する。あるいは、画像合成部8は、変換後の第2の画像および変換後の第3の画像を合成するようにしてもよい。
 さらに、図6または図9に示す画像処理装置は、ハードウェア回路で実現することができる。あるいは、この画像処理装置の一部の機能をソフトウェアで実現するようにしてもよい。例えば、差分算出部3、動き領域検出部4、シフト量選択部5、画像シフト部6、シフト量決定部7、画像合成部8、ノイズ算出部11、シフト量決定部12、スイッチ13の一部または全部がソフトウェアで実現されるようにしてもよい。
 <他の実施形態1>
 図14は、他の実施形態の画像処理方法を示すフローチャートである。この画像処理方法では、まず、第1および第2の画像間の手ぶれの平行移動成分(左右方向移動、上下方向移動、YAW、PITCHに起因する位置ずれの和)が算出される。そして、第2の画像のシフト量は、画像間の手ぶれの平行移動成分を初期値として算出される。
 ステップS41では、第1および第2の画像が取得される。ステップS42では、第1の画像の特徴点が抽出される。このとき、複数の特徴点が抽出される。ステップS43では、第2の画像において特徴点追跡が行われる。上記ステップS41~S43により、第1および第2の画像間のずれ量が算出される。画像間のずれ量は、特に限定されるものではないが、例えば下記の手順で算出されるようにしてもよい。
(1)画像保持部2Aに保持されている第1の画像において、各画素の特徴量がそれぞれ算出される。各画素の特徴量は、例えば、KLT法またはモラベックオペレータにより算出される。そして、予め決められている閾値レベルよりも大きな特徴量を有する1または複数の画素が、特徴点として抽出される。このとき、複数の特徴点が抽出されることが好ましい。
(2)画像保持部2Bに保持されている第2の画像において、第1の画像から抽出された各特徴点がそれぞれ探索される。
(3)第1および第2の画像間で、対応する特徴点の移動量(動きベクトル)が算出される。
(4)各特徴点の移動量に基づいて、2枚の画像間の位置ずれの平行移動量(dx,dy)、回転角(θ)、拡大/縮小率Sが算出される。なお、平行移動量は、画素を単位として表される。
 ステップS44では、変数dxの初期値として、各特徴点のX方向移動量の平均が設定される。また、変数dyの初期値として、各特徴点のY方向移動量の平均が設定される。ステップS45では、ステップS44で設定されたdx、dyで第2の画像に対して座標シフトが行われる。そして、ステップS46において、第1の画像と座標シフトされた第2の画像との間の動き領域(動き領域A)が検出される。
 ステップS47~S51は、基本的に、図8に示すステップS14~S18と同じである。すなわち、動き領域Bが検出され、動き領域A、Bが比較される。そして、動き領域Bが動き領域Aよりも小さくなると、その時点で選択されているシフト量が出力される。
 この手順によれば、第1および第2の画像間の位置ずれのうち、平行移動成分が初期値として設定されるので、動き領域を小さくするシフト量を算出するための処理量が少なくなる。例えば、シフト量の選択範囲が「-12」から「+12」であり、画像間の位置ずれの平行移動成分が「X方向:+9、Y方向:+6」であるものとする。この場合、例えば、シフト量dxの選択範囲は「+6」から「+12」とすることができ、また、シフト量dyの選択範囲は「+3」から「+9」とすることができる。
 このように、図14に示す手順においても、第2の画像の座標をシフトするだけで画像合成のための変換画像が生成される。このとき、第2の画像のシフト量は、手ぶれの回転成分および拡大/縮小成分も含んでいる。したがって、画像間の位置ずれの平行移動成分のみを補償する方法よりも、合成画像の画質が向上する。
 <他の実施形態2>
 図14は、さらに他の実施形態の画像処理方法を示すフローチャートである。この方法では、カメラ(画像撮影部1)の露光時間を考慮して画像処理が行われる。なお、露光時間は、カメラにより自動的に決定されてもよいし、ユーザにより指定されてもよい。
 ステップS61では、画像撮影部1の露光時間に従って、実行回数Nが決定される。実行回数Nは、ステップS65~S68を実行する回数である。ステップS62では、第1および第2の画像が取得される。ステップS63では、第1および第2の画像間の動き領域の面積dMinが算出される。動き領域の面積は、例えば、第1および第2の画像間で画素値の差分が閾値よりも大きい画素の個数に相当する。なお、dMinは、以下の処理においては、より小さい動き領域をサーチするための変数として使用される。ステップS64では、シフト量を算出するための変数dx、dyが初期化される。
 ステップS65では、図8のステップS14と同様に、シフト量選択部5により選択されたシフト量で第2の画像がシフトされる。ステップS66では、第1画像とシフトされた第2の画像との間の動き領域の面積d’が算出される。ステップS67では、面積dMinと面積d’とが比較される。
 面積d’が面積dMinよりも小さければ、ステップS68において、変数として使用されているdMinにd’が代入される。また、変数dx1、dy1に、ステップS65で選択されたシフト量dx、dyが代入される。なお、面積d’が面積dMin以上であれば、ステップS68はスキップされる。
 ステップS69では、ステップS65~S68の実行回数が「N」に達したか否かがチェックされる。「N」は、ステップS61において、画像撮影部1の露光時間に応じて決定されている。そして、実行回数が「N」に達すると、適切なシフト量をサーチする処理を終了する。
 このように、図15に示す方法では、露光時間に応じて決まる実行回数内で、動き領域を最小にするようなシフト量dx、dyが算出される。ここで、露光時間が長いときは、一般に、第1および第2の画像間の位置ずれが大きくなる。したがって、露光時間が長いときは、ステップS65~S68の実行回数を多くすることにより、広い選択範囲から適切なシフト量を得ることができる。一方、露光時間が短いときは、一般に、第1および第2の画像間の位置ずれが小さいので、適切なシフト量も小さくなるはずである。よって、ステップS65~S68の実行回数を少なくしても、適切なシフト量が得られる。これにより、演算量を少なくすることができる。
 <他の実施形態3>
 シフト量を選択する範囲は、カメラの回転または前後方向移動に起因する位置ずれに応じて決定される。例えば、撮影される画像の画素数がHeight×Widthであり、撮影時に想定されるカメラの回転角の最大値がθであるものとする。この場合、図16に示すように、カメラの回転を補償するための横方向シフト量は「-Height×sin(θ/2)」から「+Height×sin(θ/2)」の範囲内に存在する。また、カメラの回転を補償するための縦方向シフト量は「-Width×sin(θ/2)」から「+Width×sin(θ/2)」の範囲内に存在する。したがって、第1および第2の画像を合成する際に、上記範囲内で選択されるシフト量で第2の画像を変換するようにすれば、演算量が少なくなる。なお、シフト量の選択範囲を限定することで演算量を少なくする方法は、カメラの前後方向移動に起因するずれ成分を補償する場合にも有効である。以下、図17を参照しながら、カメラの回転または前後方向移動に応じて制限された範囲内でシフト量を算出する方法について説明する。
 ステップS71では、第1および第2の画像が取得される。ステップS72では、シフト量の選択範囲が指定される。この例では、横方向のシフト量の範囲は-dx0~+dx0であり、縦方向のシフト量の範囲は-dy0~+dy0である。これらの範囲は、例えば、図16を参照しながら説明した方法で決定される。また、dx0、dy0は、整数である。
 ステップS73では、第1および第2の画像間の動き領域の面積dMinが算出される。dMinは、以下の処理においては、最小の動き領域をサーチするための変数として使用される。ステップS74では、シフト量を算出するための変数を初期化する。初期値としては、各範囲の最小値が与えられる。
 ステップS75~S78の処理は、基本的に、図15に示すステップS65~S68と同じである。ただし、ここでは、dyが固定された状態で、dxについて演算が行われる。すなわち、選択されたシフト量で第2の画像がシフトされ、第1画像とシフトされた第2の画像との間の動き領域の面積d’が算出され、面積dMinと面積d’とが比較される。そして、面積d’が面積dMinよりも小さければ、変数dMinにd’が代入される。また、変数dx1に、ステップS75で選択されたシフト量dxが代入される。なお、面積d’が面積dMin以上であれば、ステップS68はスキップされる。
 ステップS79は、縦方向シフト量を固定した状態で、横方向シフト量を「-dx」から「+dx」までスキャンするために設けられている。また、ステップS80、S81は、横方向シフト量を固定した状態で、縦方向シフト量を「-dy」から「+dy」までスキャンするために設けられている。
 このように、図17に示す方法では、初期値として設定された範囲内で動き領域が最小になるシフト量が算出される。そして、第2の画像がそのシフト量で変換され、第1の画像と変換された第2の画像の合成画像が生成される。したがって、合成画像を生成する際に、合成される領域の面積が最大になり、ノイズが最小化される。なお、図14および図17に示す方法を組み合わせて実行することができる。すなわち、カメラの手ぶれに起因する画像間の位置ずれの平行移動成分に基づいてシフト量dx、dyの初期値を設定し、且つ、カメラの回転角の最大値に応じてシフト量の選択範囲を設定するようにしてもよい。
 なお、上述した3つの実施形態(他の実施形態1~3)の説明では、動き領域を小さくするシフト量が算出されているが、いずれの実施形態においても、ノイズ感を少なくするようにシフト量が算出されてもよい。
 <他の実施形態4>
 複数の画像を合成することで手ぶれを補正する画像処理方法では、動き領域の多い領域またはノイズ感の強い領域において画質が劣化しやすい。このため、この実施形態では、まず、注目領域として、動き領域の多い領域またはノイズ感の強い領域が抽出される。そして、その注目領域に対して図8、図11~図15、図17に示すフローチャートの処理が実行される。この方法によれば、少ない演算量で高画質な合成画像を作成することができる。
 注目領域は、例えば、画像を複数のブロックに分割し、各ブロックにおいて動き領域の面積またはノイズ感を算出することにより決定される。図18(a)では画像が上ブロックおよび下ブロックに分割されている。図18(b)では画像が右ブロックおよび左ブロックに分割されている。図18(c)では画像が4つのブロックに分割されている。このとき、動き領域の面積が最大のブロックまたはノイズ感が最も強いブロックが注目領域として選択される。あるいは、動き領域の面積またはノイズ感が閾値レベルを超えているブロックが注目領域として選択されるようにしてもよい。
 なお、1枚の画像に対して1つのシフト量が算出されてもよいし、ブロック毎にそれぞれシフト量が算出されるようにしてもよい。
 また、上述のようにして注目領域が検出される方法では、以下の手順で合成画像を生成するようにしてもよい。
(1)第1および第2の画像間で画素値の差分が閾値よりも大きい領域を特定する。
(2)特定された領域内の画素について、第1および第2の画像間の動きベクトルを算出する。
(3)算出した動きベクトルに従って、第2の画像の各画素の座標をシフトすることにより変換画像を生成する。
(4)第1の画像および変換画像を合成して合成画像を生成する。
 <各実施形態の共通の事項>
 図6~図18を参照しながら説明した各実施形態においては、第1および第2の画像に基づいてノイズパラメータが検出される。ここで、ノイズパラメータは、例えば、第1の実施形態では、第1および第2の画像間での動き領域の面積に相当する。第2の実施形態では、ノイズパラメータは、ノイズ感に相当する。
 また、各実施形態においては、ノイズパラメータを小さくするシフト量が算出される。ここで、ノイズパラメータを小さくする処理は、少なくとも下記の3つのアルゴリズムの中から選ぶことができる。
(1)第1の画像と変換された第2の画像との合成画像のノイズパラメータが、第1および第2の画像がそのまま合成される場合のノイズパラメータと比較して小さくなった時点で演算を終了する
(2)ノイズパラメータを最小化する
(3)所定の演算回数の中でノイズパラメータを最小化する
 さらに、各実施形態の画像処理方法は、手ぶれ補正だけでなく、他の画像合成技術にも適用可能である。例えば、各実施形態の方法は、モザイキング処理に適用することもできる。
 また、上述した各実施形態は、処理内容に矛盾の無い限りにおいて、互いに組み合わせることが可能である。
 <ハードウェア構成>
 図19は、各実施形態の画像処理装置(あるいは、画像処理方法を実行するコンピュータ)のハードウェア構成を示す図である。図19において、CPU101は、メモリ103を利用して画像処理プログラムを実行する。記憶装置102は、画像処理プログラムを格納する。なお、記憶装置102は、外部記録装置であってもよい。メモリ103は、例えば半導体メモリであり、RAM領域およびROM領域を含んで構成される。
 読み取り装置104は、CPU101の指示に従って可搬型記録媒体105にアクセスする。可搬型記録媒体105は、例えば、半導体デバイス(PCカード等)、磁気的作用により情報が入出力される媒体、光学的作用により情報が入出力される媒体を含むものとする。通信インタフェース106は、CPU101の指示に従って、ネットワークを介してデータを送受信する。入出力装置107は、この実施例では、カメラ、表示装置、ユーザからの指示を受け付けるデバイス等に相当する。
 実施形態に係わる画像処理プログラムは、例えば、下記の形態で提供される。
(1)記憶装置102に予めインストールされている。
(2)可搬型記録媒体105により提供される。
(3)プログラムサーバ110からダウンロードする。
そして、上記構成のコンピュータで画像処理プログラムを実行することにより、実施形態に係わる画像処理装置が実現される。

Claims (12)

  1.  連続撮影により得られる複数の画像の中の第1および第2の画像から合成画像を生成する画像処理方法であって、
     前記第1および第2の画像に基づいてノイズパラメータを検出し、
     前記ノイズパラメータを小さくするシフト量を算出し、
     前記シフト量に従って前記第2の画像の各画素の座標をシフトすることにより変換画像を生成し、
     前記第1の画像および前記変換画像を合成して合成画像を生成する
     画像処理方法。
  2.  請求項1に記載の画像処理方法であって、
     前記ノイズパラメータとして、前記第1および第2の画像間で画素値の差分の絶対値が閾値よりも大きい領域を検出し、
     前記領域を小さくするシフト量を算出する
     ことを特徴とする画像処理方法。
  3.  請求項1に記載の画像処理方法であって、
     前記ノイズパラメータとして、前記第1および第2の画像の合成画像のノイズ感を算出し、
     前記ノイズ感を低くするシフト量を算出する
     ことを特徴とする画像処理方法。
  4.  請求項1に記載の画像処理方法であって、
     前記ノイズパラメータとして、前記第1および第2の画像の各画素値の差分が閾値よりも大きい領域を検出すると共に、前記第1および第2の画像の合成画像のノイズ感を算出し、
     前記ノイズ感が予め決められた閾値よりも低ければ、前記領域を小さくするシフト量を算出し、前記ノイズ感が予め決められた閾値よりも高ければ、前記ノイズ感を低くするシフト量を算出する
     ことを特徴とする画像処理方法。
  5.  請求項1に記載の画像処理方法であって、
     前記ノイズパラメータとして、前記第1および第2の画像間で画素値の差分が閾値よりも大きい領域を検出し、
     前記領域を小さくする第1のシフト量を算出し、
     前記ノイズパラメータとして、前記第1および第2の画像の合成画像のノイズ感を算出し、
     前記ノイズ感を低くする第2のシフト量を算出し、
     前記ノイズ感に対応する重みを算出し、
     前記第1のシフト量、前記第2のシフト量、前記重みに基づいてシフト量を算出する
     ことを特徴とする画像処理方法。
  6.  請求項1~3のいずれか1つに記載の画像処理方法であって、
     前記第1および第2の画像間の位置ずれ平行移動成分を検出し、
     前記シフト量は、前記平行移動成分を初期値として算出される
     ことを特徴とする画像処理方法。
  7.  請求項1~3のいずれか1つに記載の画像処理方法であって、
     前記シフト量は、前記ノイズパラメータを利用するフィードバック演算で算出されるものであり
     前記フィードバック演算の実行回数は、前記撮影の露光時間に応じて決まる
     ことを特徴とする画像処理方法。
  8.  請求項1~3のいずれか1つに記載の画像処理方法であって、
     前記シフト量は、前記第1または第2の画像のサイズおよび前記第1および第2の画像間の位置ずれ回転角度の想定される最大値に基づいて決まる範囲内で算出される
     ことを特徴とする画像処理方法。
  9.  請求項1~3のいずれか1つに記載の画像処理方法であって、
     前記ノイズパラメータは、画像内の注目領域において検出される
     ことを特徴とする画像処理方法。
  10.  連続撮影により得られる複数の画像の中の第1および第2の画像から合成画像を生成する画像処理方法であって、
     前記第1および第2の画像間で画素値の差分が閾値よりも大きい領域を特定し、
     前記特定された領域内の画素について、前記第1および第2の画像間の動きベクトルを算出し、
     前記動きベクトルに従って前記第2の画像の各画素の座標をシフトすることにより変換画像を生成し、
     前記第1の画像および前記変換画像を合成して合成画像を生成する
     画像処理方法。
  11.  連続撮影により得られる複数の画像の中の第1および第2の画像から合成画像を生成する画像処理装置であって、
     前記第1および第2の画像に基づいてノイズパラメータを検出するノイズパラメータ検出部と、
     前記ノイズパラメータを小さくするシフト量を算出するシフト量算出部と、
     前記シフト量に従って前記第2の画像の各画素の座標をシフトすることにより変換画像を生成する画像シフト部と、
     前記第1の画像および前記変換画像を合成して合成画像を生成する画像合成部、
     を有する画像処理装置。
  12.  連続撮影により得られる複数の画像の中の第1および第2の画像から合成画像を生成するために、コンピュータに、
     前記第1および第2の画像に基づいてノイズパラメータを検出する手順、
     前記ノイズパラメータを小さくするシフト量を算出する手順、
     前記シフト量に従って前記第2の画像の各画素の座標をシフトすることにより変換画像を生成する手順、
     前記第1の画像および前記変換画像を合成して合成画像を生成する手順
     を実行させる画像処理プログラム。
PCT/JP2009/003930 2009-08-18 2009-08-18 画像処理方法および画像処理装置 WO2011021235A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
PCT/JP2009/003930 WO2011021235A1 (ja) 2009-08-18 2009-08-18 画像処理方法および画像処理装置
JP2011527480A JP5158262B2 (ja) 2009-08-18 2009-08-18 画像処理方法および画像処理装置
US13/367,707 US20120133786A1 (en) 2009-08-18 2012-02-07 Image processing method and image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2009/003930 WO2011021235A1 (ja) 2009-08-18 2009-08-18 画像処理方法および画像処理装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US13/367,707 Continuation US20120133786A1 (en) 2009-08-18 2012-02-07 Image processing method and image processing device

Publications (1)

Publication Number Publication Date
WO2011021235A1 true WO2011021235A1 (ja) 2011-02-24

Family

ID=43606707

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2009/003930 WO2011021235A1 (ja) 2009-08-18 2009-08-18 画像処理方法および画像処理装置

Country Status (3)

Country Link
US (1) US20120133786A1 (ja)
JP (1) JP5158262B2 (ja)
WO (1) WO2011021235A1 (ja)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI426775B (zh) * 2010-12-17 2014-02-11 Ind Tech Res Inst 攝影機再校正系統及其方法
JP5781351B2 (ja) * 2011-03-30 2015-09-24 日本アビオニクス株式会社 撮像装置、その画素出力レベル補正方法、赤外線カメラシステム及び交換可能なレンズシステム
JP5778469B2 (ja) 2011-04-28 2015-09-16 日本アビオニクス株式会社 撮像装置、画像生成方法、赤外線カメラシステム及び交換可能なレンズシステム
US9886552B2 (en) 2011-08-12 2018-02-06 Help Lighting, Inc. System and method for image registration of multiple video streams
US9020203B2 (en) 2012-05-21 2015-04-28 Vipaar, Llc System and method for managing spatiotemporal uncertainty
JP6153318B2 (ja) * 2012-11-30 2017-06-28 キヤノン株式会社 画像処理装置、画像処理方法、画像処理プログラム、および、記憶媒体
US9940750B2 (en) 2013-06-27 2018-04-10 Help Lighting, Inc. System and method for role negotiation in multi-reality environments
CN105794195B (zh) * 2014-10-27 2020-02-07 松下知识产权经营株式会社 图像形成系统、图像形成方法以及拍摄元件

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007213191A (ja) * 2006-02-08 2007-08-23 Fujitsu Ltd 動き検出プログラム、動き検出方法、動き検出装置、
JP2007226643A (ja) * 2006-02-24 2007-09-06 Morpho Inc 画像処理装置
JP2009130489A (ja) * 2007-11-21 2009-06-11 Sony Corp 撮像装置、撮像記録方法、撮像画像記録再生装置および撮像画像記録再生方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4640579B2 (ja) * 2005-01-27 2011-03-02 ソニー株式会社 情報処理装置および回収基板
JP5016255B2 (ja) * 2006-02-22 2012-09-05 富士フイルム株式会社 ノイズ低減装置ならびにその制御方法およびその制御プログラムならびに撮像装置およびディジタル・カメラ
US20080024469A1 (en) * 2006-07-31 2008-01-31 Niranjan Damera-Venkata Generating sub-frames for projection based on map values generated from at least one training image

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007213191A (ja) * 2006-02-08 2007-08-23 Fujitsu Ltd 動き検出プログラム、動き検出方法、動き検出装置、
JP2007226643A (ja) * 2006-02-24 2007-09-06 Morpho Inc 画像処理装置
JP2009130489A (ja) * 2007-11-21 2009-06-11 Sony Corp 撮像装置、撮像記録方法、撮像画像記録再生装置および撮像画像記録再生方法

Also Published As

Publication number Publication date
JPWO2011021235A1 (ja) 2013-01-17
JP5158262B2 (ja) 2013-03-06
US20120133786A1 (en) 2012-05-31

Similar Documents

Publication Publication Date Title
JP5158262B2 (ja) 画像処理方法および画像処理装置
JP4620607B2 (ja) 画像処理装置
JP5017419B2 (ja) 画像生成装置、画像生成方法、およびプログラム
JP4720859B2 (ja) 画像処理装置、画像処理方法およびプログラム
US8068700B2 (en) Image processing apparatus, image processing method, and electronic appliance
US7548659B2 (en) Video enhancement
US7502522B2 (en) Video processing system and method for automatic enhancement of digital video
US7973827B2 (en) Image data generating apparatus, method and program for generating an image having high spatial and high temporal resolution
US9055217B2 (en) Image compositing apparatus, image compositing method and program recording device
JP5767485B2 (ja) 画像処理装置及び制御方法
US8094230B2 (en) Image processing apparatus, image processing method, and program
JP5672796B2 (ja) 画像処理装置、画像処理方法
WO2012056518A1 (ja) 画像処理装置、画像処理方法及び画像処理プログラム
JP2008060927A (ja) 画像合成装置及び方法並びに撮像装置
JP2010200179A (ja) 画像処理装置、画像処理方法、画像処理プログラムおよび画像処理プログラムが格納されたプログラム記憶媒体
CN109076144B (zh) 图像处理装置、图像处理方法以及存储介质
JP2012142829A (ja) 画像処理装置および画像処理方法
JP2008077501A (ja) 画像処理装置及び画像処理制御プログラム
CN114339030B (zh) 一种基于自适应可分离卷积的网络直播视频稳像方法
US7970227B2 (en) Image processing apparatus, image processing method, and computer program
JP5493112B2 (ja) 画像処理装置、画像処理方法及び画像処理プログラム
JP2010232710A (ja) 画像処理装置および画像処理方法
JPWO2015083502A1 (ja) 画像処理装置、該方法および該プログラム
JP6708131B2 (ja) 映像処理装置、映像処理方法及びプログラム
JP5486280B2 (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: 09848440

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2011527480

Country of ref document: JP

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 09848440

Country of ref document: EP

Kind code of ref document: A1