WO2007141886A1 - 手ブレ状況推測プログラム及びこれが記録されたコンピュータ読み取り可能な記録媒体、ならびに手ブレ状況推測装置 - Google Patents

手ブレ状況推測プログラム及びこれが記録されたコンピュータ読み取り可能な記録媒体、ならびに手ブレ状況推測装置 Download PDF

Info

Publication number
WO2007141886A1
WO2007141886A1 PCT/JP2006/315679 JP2006315679W WO2007141886A1 WO 2007141886 A1 WO2007141886 A1 WO 2007141886A1 JP 2006315679 W JP2006315679 W JP 2006315679W WO 2007141886 A1 WO2007141886 A1 WO 2007141886A1
Authority
WO
WIPO (PCT)
Prior art keywords
camera shake
strips
pixels
average length
image
Prior art date
Application number
PCT/JP2006/315679
Other languages
English (en)
French (fr)
Inventor
Syunichi Yanagida
Original Assignee
Nippon Computer System Co., Ltd
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 Nippon Computer System Co., Ltd filed Critical Nippon Computer System Co., Ltd
Publication of WO2007141886A1 publication Critical patent/WO2007141886A1/ja

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/73Deblurring; Sharpening
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details
    • G06T2207/20201Motion blur correction

Definitions

  • Camera shake situation estimation program computer-readable recording medium on which the program is recorded, and camera shake situation estimation apparatus
  • the present invention relates to a camera shake situation estimation program capable of accurately estimating the direction and the number of pixels of a camera shake prior to sharpening a blurred image, and a computer reading in which the camera shake is recorded
  • the present invention relates to a possible recording medium and a camera shake situation estimation device.
  • a photographic image may be blurred.
  • the blur include a blur caused by a shift in focal length, a blur caused by camera shake of a photographer, and a subject blurred due to a subject moving.
  • a so-called unsharp mask or Laplacian filter is conventionally used as a method for correcting such a blurred image into a sharp image, that is, a sharp image (see, for example, Patent Document 1 and Patent Document 2).
  • Patent Document 1 Japanese Patent Application Publication No. JP 2006-031195
  • Patent Document 2 Japanese Patent Application Publication Number JP 2006-011619 A Disclosure of Invention
  • the present invention has been made in view of such a problem.
  • the number of pixels in which direction the camera shake is generated during image capture is determined.
  • a means for accurately estimating the applied force at a low cost is provided.
  • FIG. 1 is a block diagram showing a configuration of an image processing apparatus 1 according to an embodiment of the present invention.
  • FIG. 2 is a flowchart showing a processing flow of an image processing program 6.
  • FIG. 3 is a diagram showing an example of a brightness difference between a target pixel 13 and pixels adjacent in the surrounding eight directions.
  • FIG. 4 is a diagram illustrating an example of a brightness difference between a target pixel 13 and pixels adjacent in the surrounding eight directions.
  • FIG. 5 is a diagram showing an example of a brightness difference between a target pixel 13 and pixels adjacent in the surrounding eight directions.
  • FIG. 6 is a diagram showing an example of a brightness difference between a target pixel 13 and pixels adjacent in the surrounding eight directions.
  • FIG. 7 is an explanatory diagram for explaining the strip 22.
  • FIG. 8 is a flowchart showing the flow of processing in the out-of-focus only handling mode (S3).
  • FIG. 9 is a graph for calculating the first intermediate value.
  • FIG. 10 is a graph for calculating the second intermediate value.
  • FIG. 11 is a graph for calculating the second intermediate value.
  • FIG. 12 is an explanatory diagram for explaining how a photon emitted from a subject H force reaches the image sensor surface S.
  • FIG. 13 is an explanatory diagram for explaining the occurrence of camera shake.
  • FIG. 14 is an explanatory diagram for explaining occurrence of blurring.
  • FIG. 15 is an explanatory diagram for explaining the total number of photons received by the image sensor (X, y).
  • FIG. 16 is a frequency distribution table showing the frequency distribution of [difference in brightness of adjacent pixels] for all pixels included in a mesh.
  • FIG. 17 is a flowchart showing a flow of processing in the out-of-focus / blurring handling mode (S4).
  • FIG. 18 A diagram showing [original data table for spreading factor setting].
  • FIG. 1 is a block diagram illustrating the configuration of the image processing apparatus 1 according to the present embodiment.
  • This image processing device 1 generates a new image that is sharpened based on the input original image and the media reader (original image input means) 2 for inputting the image data of the original image to be corrected. And a photographic printer 4 for printing out the generated new image.
  • the media reader 2 is for reading original image data stored in various storage media such as a memory card and a CD and inputting it to the computer 3.
  • various storage media such as a memory card and a CD
  • the computer 3 includes an image memory 5 that stores the original image data input from the media reader 2, a hard disk 7 that stores an image processing program 6 for image sharpening, and a read from the hard disk 7.
  • RAM Random Access Memory
  • CPU Central Processing Unit
  • a display unit 10 for displaying the processed image and an operation unit 11 composed of a mouse, a keyboard and the like are connected via a system node 12. It is also possible to store the sharpened image on the hard disk 7.
  • This image processing program 6 is created using various programming languages and is based on the original image data! / And approximates the ideal image of the time without any blur or camera shake. is there.
  • FIG. 2 is a flowchart showing the flow of processing of the image processing program 6.
  • a camera shake situation estimation process S1 is first performed on the input original image.
  • S2 the out-of-focus mode
  • S3 the out-of-focus mode
  • S4 the out-of-focus camera shake handling mode
  • the camera shake situation estimation process (S1) is a process of estimating the camera shake direction [blurring direction] and the number of pixels [number of blebixels] that occurred during shooting by analyzing the input original image data. It is.
  • a camera shake occurs, a photon that was generated by the subject and was supposed to be received by one image sensor with a digital camera is the direction of camera shake relative to the image sensor. It can also be received by an image sensor located in the opposite direction. Thereby, in the original image, attributes such as brightness are close to each other, and a strip-like portion in which pixels are continuous in a predetermined direction is generated.
  • the force with this threshold value set to 0.05 can be changed appropriately.
  • the target pixel 13 has almost the same brightness as the pixels 14 and 15 on both the left and right sides, and the brightness is somewhat different from the other neighboring pixels.
  • the target pixel 13 has almost the same brightness as either of the left and right neighboring pixels 14 and 15, but the brightness is somewhat different from the other neighboring pixels. In this case, it is determined that the target pixel 13 is flat in the horizontal direction.
  • FIG. 4 (a) when the target pixel 13 has almost the same brightness as the pixels 16 and 17 on both the upper and lower sides, and the brightness is somewhat different from the other neighboring pixels.
  • the target pixel 13 is almost the same in brightness as either the upper or lower neighbor pixels 16, 17, and the other neighboring pixels are the brightness.
  • the force S is different to some extent, it is determined that the target pixel 13 is flat in the vertical direction.
  • FIG. 5 and FIG. 6 are diagrams showing another example of the brightness difference between the target pixel 13 and pixels adjacent in the surrounding eight directions.
  • the hatched pixels are pixels whose brightness difference from the target pixel 13 is smaller than the predetermined threshold
  • the pixels that are blacked out are pixels whose brightness difference from the target pixel 13 is larger than the predetermined threshold.
  • the pixels painted in white mean the pixels regardless of the brightness difference from the target pixel 13.
  • the target pixel 13 has almost the same brightness as the pixels 18 and 19 on the lower left and upper right, and the brightness is almost the same as the other adjacent pixels.
  • the target pixel 13 has almost the same brightness as either the lower left or upper right neighboring pixels 18, 19 When it cannot be said that the brightness is almost the same as that of the other adjacent pixels, it is determined that the target pixel 13 is flat in the lower left and upper right directions.
  • the target pixel 13 has almost the same brightness as both the upper left and lower right adjacent pixels 20, 21, and the other adjacent pixels have the same brightness. If it is not almost the same, or as shown in Fig. 6 (b) and Fig. 6 (c), the target pixel 13 has almost the same brightness as either the upper left or lower right neighboring pixels 20, 21 If it cannot be said that the brightness is almost the same as other neighboring pixels, it is determined that the target pixel 13 is flat in the upper left and lower right directions.
  • the target pixel 13 is not flat when the brightness difference between the target pixel 13 and the neighboring pixels in the surrounding eight directions does not correspond to any of FIGS. Judge.
  • the average length of the strips 22 is calculated for each direction.
  • strips 22 whose length is shorter than 2 pixels and strips 22 longer than the predetermined upper limit are excluded from the calculation of the average length. This is because if the length is shorter than 2 pixels, it cannot be said that the strip 22 is practically formed, and if the length is longer than the upper limit, it does not actually exist on the subject other than the strip 22 caused by camera shake. This is because there is a high probability that the pixels that are close in brightness will be continuous.
  • the upper limit is set to 8 pixels, but the setting can be changed as appropriate.
  • the [blur direction] is estimated based on the average length of the strips 22 calculated for each direction.
  • the [blurring direction] is estimated by checking the direction in which the strips 22 are formed most and determining the direction as [blur direction]. More specifically, among the average lengths of strips 22 calculated for each direction, the average strip length in the horizontal direction is compared with the average strip length in the vertical direction, and the average strip length in the horizontal direction is the vertical direction. Is equal to or greater than the average strip length, the [horizontal-vertical strip distribution ratio] is calculated by the following equation (1). On the other hand, when the average strip length in the horizontal direction is smaller than the average strip length in the vertical direction, [horizontal-vertical strip distribution ratio] is calculated by the following equation (2).
  • the average strip length in the lower left one upper right direction is compared with the average strip length in the upper left one lower right direction, and the lower left one upper right direction If the average strip length is equal to or greater than the average strip length in the upper left and lower right direction, the [oblique strip distribution ratio] is calculated by the following equation (3).
  • the average strip length in the lower left one upper right direction is the upper left one lower right If it is smaller than the average strip length in the direction, calculate [Diagonal strip distribution ratio] using the following formula (4).
  • the [horizontal one vertical strip distribution ratio] is greater than or equal to [diagonal strip distribution ratio]. If the average strip length in the horizontal direction is equal to or greater than the average strip length in the vertical direction, the [blur direction] is determined in the horizontal direction. On the other hand, if [Horizontal-vertical strip distribution ratio] is equal to or greater than [Diagonal strip distribution ratio] and the horizontal average strip length is smaller than the vertical average strip length, Determine the vertical direction.
  • the direction in which strips 22 are most formed is defined as [blur direction].
  • the direction in which the largest number of strips 22 is formed in the state where only a small number of strips 22 with few pixels that can form the strips 22 are formed is defined as the blur direction.
  • the certainty level differs from the case where it is determined. Therefore, in the present invention, as a coefficient indicating the degree of certainty in the estimation of [blurring direction], in addition to [confidence regarding blur direction], [a Have been introduced.
  • the [majority formation 'pixel number] in the equation (6) when [blurring direction] is the horizontal direction, the number of pixels having flatness in the horizontal direction in the original image is represented by Is vertical, the number of pixels that have flatness in the horizontal direction in the original image, and if [blurring direction] is in the lower left, upper right, the flatness is in the lower left, upper right in the original image.
  • the [blurring direction] is in the upper left, lower right direction, the number of pixels having flatness in the upper left, lower right direction is employed.
  • FIG. 8 is a flowchart showing the flow of processing in the out-of-focus only mode (S3).
  • this image processing program 6 performs sharpening processing on the original image on the assumption that photons emitted from the subject diffuse according to a two-dimensional normal distribution.
  • the standard deviation ⁇ which is a parameter of the two-dimensional normal distribution, is set to an optimum value, and then sharpening processing is performed on the original image.
  • the standard deviation ⁇ is set to the upper limit value and sharpening processing is executed on the original image (S5).
  • a practical upper limit value and a lower limit value are predetermined as standard deviation ⁇ , which is a parameter of a two-dimensional normal distribution.
  • the upper limit value is a limit value at which the sharpness of the image increases, but the roughness of the image becomes unbearable when the standard deviation ⁇ is further increased.
  • the lower limit value is a limit value at which the sharpening effect cannot be obtained or the image becomes abnormal when the standard deviation ⁇ becomes smaller than that.
  • the upper limit is set to 0.7 and the lower limit is set to 0.3.
  • the setting is not limited to this embodiment and can be changed as appropriate. The details of the sharpening process will be described later, and the description thereof is omitted here.
  • the roughness measurement process is executed on the image after the sharpening process (S6).
  • the measured roughness is defined as [roughness' standard deviation ⁇ upper limit setting], and this is compared with the reference roughness (threshold) (S7).
  • This rough roughness value is a rough value of the roughness that a good sharpening effect can be obtained if the roughness becomes this level. In this embodiment, this roughness is set to 30. is doing. Of course, this rough roughness can be changed as appropriate. If [Roughness / Standard deviation / Upper limit setting] is smaller than the standard roughness (S7: Yes), the standard deviation ⁇ is set to the upper limit value, and the original image is sharpened (S8).
  • the process ends. In this way, even if the strongest sharpening process is performed with the standard deviation ⁇ set to the upper limit value, if the roughness of the image after the sharpening process does not reach the standard roughness, the standard deviation ⁇ The upper limit is adopted as the optimum value of. Note that the details of the roughness measurement processing will be described later, so the description thereof is omitted here.
  • the standard deviation ⁇ is set to the lower limit value, and sharpening processing is executed on the original image (S9). Then, a roughness measurement process is executed for the image after the sharpening process (S10).
  • the measured roughness is defined as [roughness 'standard deviation' lower limit setting], and this is compared with the rough roughness (Sl l). If [Roughness / Standard deviation / Lower limit setting] is larger than the standard roughness! (S11: Yes), set the standard deviation ⁇ to the lower limit and sharpen the original image. (S12) After the sharpened image is output as the final result, the process ends.
  • the standard deviation ⁇ is adopted as the optimum value of. Even in this case, the lower limit value is set to such a level that there is almost no difference between the images before and after the sharpening process. Therefore, the standard deviation ⁇ is set to the lower limit value to withstand the image. No state never happen.
  • the standard deviation ⁇ is set to the first intermediate value, and the sharpening process is executed on the original image (S14).
  • the roughness measurement process is executed on the image after the sharpening process (S15).
  • the measured roughness is defined as [roughness / standard deviation, first intermediate value setting].
  • a second intermediate value of standard deviation ⁇ is calculated (S16).
  • the second intermediate value is a value closer to the optimum value than the first intermediate value, and is set between the lower limit value and the first intermediate value, or between the first intermediate value and the upper limit value. is there.
  • the calculation method of the second intermediate value is [Roughness' standard deviation ⁇ 1st intermediate value setting] larger than the standard roughness! It is classified into two types according to whether or not. First, when [Roughness ⁇ Standard deviation ⁇ First intermediate value] is larger than the standard roughness, create a graph with the standard deviation ⁇ on the X axis and the roughness on the Y axis, as shown in Fig. 10.
  • the roughness changes linearly as the standard deviation ⁇ changes to the lower limit force upper limit value
  • the standard deviation ⁇ value at which the roughness becomes the reference roughness value is the first value.
  • set the standard deviation ⁇ to the intermediate value and perform sharp edge processing to measure the roughness of the image, so that the roughness becomes closer to the approximate roughness.
  • the approximate value of the standard deviation ⁇ is approximated by the procedure of calculating the intermediate value.
  • the second intermediate value is adopted as the optimum value of the standard deviation ⁇ , but the third intermediate value is further between the lower limit value and the second intermediate value, or between the second intermediate value and the upper limit value. It is also possible to calculate and adopt this as the optimum value. It is also possible to calculate the fourth intermediate value and the fifth intermediate value ⁇ and adopt them as the optimum values in the same procedure.
  • the sharpening process (S5, S8, S9, S12, S14, S17) in the out-of-focus only mode (S3) shown in FIG. 8 will be described.
  • the mechanism of occurrence of out-of-focus and camera shake in a digital camera will be described.
  • an imaging device an element that reacts electrically when receiving light
  • an object to be photographed hereinafter referred to as an “subject”.
  • the surface of the subject H is divided into a grid, and a predetermined portion of the subject H located in each grid is represented as a subject (X, y), and the subject (X, y)
  • the number of photons that have reached the imaging device surface S of the digital camera that is, the amount of light among all the photons that have also generated this partial force, is expressed as output light quantity—subject (X, y).
  • the image pickup device surface S of the digital camera is formed by arranging the same number of image pickup devices as the number of divisions of the subject, and a predetermined portion of the image pickup device is represented as an image pickup device (X, y).
  • , y) represents the number of photons received, that is, the amount of light, as input light quantity-image sensor (X, y).
  • the camera is powered by the camera performance limit while the shutter is open (camera shake), and the subject H is out of focus. Due to circumstances such as out of focus, the photon (X, y) force that does not completely hold equation (9) is also generated, and some of the photons that have reached the image sensor surface S of the digital camera are part of the image sensor (X, It is received by image sensors other than y).
  • image sensors other than y For example, when camera shake occurs, as shown in FIG. 13, some of the photons that have reached the image sensor are captured by the image sensor that is located in the direction opposite to the camera shake direction with respect to the image sensor (X, y). It is received and this causes pre-blurring.
  • the focal length does not match the subject H, as shown in FIG. 14, some of the photons that reach the image sensor diffuse in all directions and are captured by the image sensor around the image sensor (X, y). It is received and this causes blurring.
  • Table 1 is a table showing an example of the photon diffusion rate.
  • about 40% of the photons that reach the image sensor surface S from the subject (X, y) are received by the image sensor (X, y), and about 10% are image sensors (X, y-1), Image sensor (X, y + 1), image sensor (x-l, y), and image sensor (x + 1, y), respectively, about 5% are image sensor (x-l, y-1), image sensor This means that it is received by the element (x ⁇ l, y + 1), the image sensor (x + 1, y ⁇ 1), and the image sensor (x + 1, y + 1).
  • the photon that also generated the subject (X, y) force Is limited to the range of the image sensor (X, y) and a total of nine adjacent image sensors surrounding the image sensor (X, y), and does not diffuse to the range of the image sensor outside it. Meaning.
  • Table 1 Table showing diffusivity of photons
  • the input light quantity in Expression (10) imaging element (X, y) is a known value obtained for all X and y by referring to the original image data input from the media reader 2. Therefore, based on this known input light quantity—image sensor (X, y), the total number of photons that have reached the image sensor surface S of the digital camera out of all photons emitted from the subject (X, y) By obtaining the output light quantity—subject (X, y) for all X and y, an accurate image of the photographed subject H can be obtained. That is, it is possible to know an accurate image of the subject H without any blur based on the original image where the blur occurs.
  • Output light intensity _Subject (X—1, y) is input light intensity _Output to image sensor (X—1, y)
  • Light quantity _Subject ( ⁇ + 1, y) as input light quantity—Image sensor ( ⁇ + 1, y)
  • Output light quantity—Subject (X, y—l) as input light quantity _Image sensor (X, y—l)
  • Output light quantity_subject (X, y + 1) is input light quantity_image sensor (X, y + 1)
  • output light quantity—subject ( ⁇ -1, -1) is input light quantity-image sensor -1
  • Output light quantity _Subject (x + 1, y-1) to input light quantity _Image sensor (x + 1, y-1)
  • the diffusion rate of photons is not limited to Table 1, and can be changed to an arbitrary setting, and the degree of blur correction is increased or decreased by changing the setting of the diffusion rate. Can be adjusted.
  • photons emitted from the subject (X, y) are diffused into a range of a total of nine image sensors adjacent to the image sensor (X, y) and surrounding the image sensor (X, y).
  • Tables 2 and 3 below show examples of spreading factor settings in this case.
  • Table 2 shows setting examples when the degree of out-of-focus correction is increased, and Table 3 shows Table 2.
  • An example of setting when the correction level is weaker is shown.
  • Table 2 Table showing the diffusion rate of photons (Set the degree of out-of-focus correction to a higher level)
  • Table 3 Table showing the diffusion rate of photons (Set the degree of defocus correction to be weak)
  • Table 1, Table 2, and Table 3 have been described as examples of photon diffusivity tables.
  • the table showing photon diffusivity is arbitrarily set and changed. It is possible to change.
  • a table indicating the photon diffusion rate is set on the assumption that the photon force emitted from the subject is diffused according to a dimensional normal distribution. This is a force that can be adjusted easily by increasing or decreasing the degree of defocus correction by controlling only one parameter, the standard deviation.
  • the image processing algorithm in this case is the same as that described above in that it is performed using Expression (14), and the description thereof is omitted here.
  • the image processing program 6 sets the photon diffusivity for out-of-focus correction. By using different settings, it is possible to correct camera shake blur.
  • Table 4 shows examples of photon diffusivity settings when correcting camera shake blur.
  • the image sensor adjacent to the direction opposite to the camera shake direction (X—1, y)
  • the imaging element (X-2, y) adjacent to it receives the photons.
  • Table 4 Table showing diffusivity of photons (when blurring is corrected)
  • the size of the mesh should be such that the number of meshes does not exceed 1000 in the horizontal and vertical directions of the original image.
  • equation (17) ⁇ average in mesh—input light quantity—imaging element (m, n) ⁇ means the mesh (m, n) located in the original image at the mth position in the horizontal direction and the nth position in the vertical direction. ), The ⁇ input light quantity—imaging element (X, y) ⁇ is examined for all the imaging elements (X, y) existing therein, and the average value thereof is calculated.
  • adjacent pixel means a pixel determined as follows rather than a pixel stored adjacently on the image data.
  • V the number of pixels stored in the vertical direction
  • K the number of pixels is K
  • the adjacent pixel of (X, y) can be expressed as pixel (X—I, y) by using I calculated by the following equations (18) and (19). This means that the pixel is stored at a position separated by I pixels in the left direction when a certain pixel (X, y) force is seen.
  • the adjacent pixels are not limited to pixels adjacent in the left direction, and pixels adjacent in an arbitrary direction can be selected.
  • a frequency distribution table is created with the brightness difference displayed at 0.1 horizontal intervals on the horizontal axis and the frequency displayed on the vertical axis.
  • the sum of the frequencies in the lightness difference range of 0.1 to +0.1 is defined as [central area * total frequency], while the area located outside this central area, that is, the brightness difference.
  • the sum of the frequencies in the range from 0.3 to 0.1 and +0.1 to +0.3 is defined as [near-center region / total frequency].
  • the roughness of the mesh can be expressed by the following equation (20).
  • the horizontal axis of the frequency distribution table is not limited to the 0.1 width interval, but can be any width interval.
  • FIG. 17 is a flowchart showing the flow of processing in the out-of-focus / hand shake countermeasure mode (S4).
  • this image processing program 6 executes sharpening processing on the current image on the assumption that photons emitted from the subject diffuse according to a two-dimensional normal distribution.
  • the out-of-focus / hand shake countermeasure mode (S4) is characterized by the fact that the photon diffusivity is set differently from the out-of-focus only mode (S3), so that it can also cope with hand shake.
  • a flat wrinkle parameter value is calculated based on the output result of the camera shake situation estimation process (S 1).
  • the flattening parameter value consists of three numerical forces: [the long axis direction angle of the flattening process], [long axis direction 'magnification], and [short axis direction' magnification]. It is calculated based on the three types of information output from (S1): [blur direction], [number of brevic cells], and [total judgment 'confidence]. [A major axis direction angle of the flattening process] is determined by the [blur direction].
  • Figure 18 shows the original data for spreading factor setting. [Table].
  • the coordinates shown in the figure are assigned to each square constituting the [Diffusion rate setting original data 'table].
  • the following formula (24) force is also set using [value set for grid (X, y)] calculated using formula (29).
  • Equation (30) means the total sum over all squares of [original data of diffusion rate setting table] (value set in square (X, y)).
  • the present invention provides an image processing product that corrects out-of-focus images and camera shake images into sharp images.
  • the present invention is applicable to an image processing apparatus and an image processing apparatus.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Studio Devices (AREA)

Abstract

 本手ブレ状況推測プログラムは、対象となる画像を構成する複数の画素について、色の属性に関し隣接する周囲の画素との差異を測定してその絶対値が所定の閾値より小さい方向をその画素が平坦性を有する方向とし、同じ方向に平坦性を有する連続した画素群を短冊として形成し、各方向毎に算出した短冊の平均長さに基づいて手ブレ方向を推測するとともに、その手ブレ方向に形成された短冊の平均長さを手ブレ画素数と推測するものである。

Description

明 細 書
手ブレ状況推測プログラム及びこれが記録されたコンピュータ読み取り可 能な記録媒体、ならびに手ブレ状況推測装置
技術分野
[0001] 本発明は、ボケが生じた画像を先鋭ィ匕するに先立って、手ブレの方向とその画素 数を精度良く推測することが可能な手ブレ状況推測プログラム及びこれが記録された コンピュータ読み取り可能な記録媒体、ならびに手ブレ状況推測装置に関する。 背景技術
[0002] デジタルカメラ等を用いて被写体を撮影した場合、写真画像にボケが生じる場合が ある。このボケとしては、焦点距離のズレに起因するピンボケと、撮像者の手のぶれ に起因する手ブレボケと、被写体が動くことに起因する被写体ブレボケとが挙げられ る。このようなボケ画像を先鋭ィ匕すなわちくっきりとした画像に修正する方法として、い わゆるアンシャープマスクやラプラシアンフィルタによる処理が従来用いられて 、る ( 例えば特許文献 1及び特許文献 2参照)。
[0003] し力し、アンシャープマスクやラプラシアンフィルタを用いた先鋭化処理では、ピン ボケと手ブレボケの双方を包括的に先鋭ィ匕することができな 、ため、画像に生じたボ ケに応じてアンシャープマスクやラプラシアンフィルタ等を適宜使い分ける必要がある 。従って、有効な先鋭ィ匕処理を実現するためには、先鋭ィ匕処理に先立って、対象と なる画像の撮影時に手ブレがどちら向きに何画素分生じたかを精度良く推測すること が必要となる。
[0004] 従来、対象画像につ!、て手ブレの発生状況を推測する手法としては、デジタルカメ ラ等に搭載されて撮影時に手ブレをハード的に検出する方法や、対象画像のスぺク トルを分析してその分析したスペクトルをフーリエ変換することによりソフト的に検出す る方法が用いられている。
[0005] しかし、上記のようにフーリエ変換によりソフト的に手ブレの発生状況を推測する方 法は、計算が複雑なものとなり、計算コストが高くなるという問題があった。
[0006] 特許文献 1 :日本国特許出願公開番号 特開 2006— 031195号公報 特許文献 2 :日本国特許出願公開番号 特開 2006— 011619号公報 発明の開示
[0007] 本発明は、このような問題に鑑みてなされたものであり、ボケが生じた画像に対する 先鋭ィ匕処理を実行するに先立って、画像撮影時に手ブレがどちら向きに何画素分生 じた力を安価なコストで精度良く推測する手段を提供する。
図面の簡単な説明
[0008] [図 1]本発明の実施例に係る画像処理装置 1の構成を示すブロック図。
[図 2]画像処理プログラム 6の処理の流れを示すフローチャート。
[図 3]対象ピクセル 13と周囲 8方向に隣接するピクセルとの明度差の一例を示す図。
[図 4]対象ピクセル 13と周囲 8方向に隣接するピクセルとの明度差の一例を示す図。
[図 5]対象ピクセル 13と周囲 8方向に隣接するピクセルとの明度差の一例を示す図。
[図 6]対象ピクセル 13と周囲 8方向に隣接するピクセルとの明度差の一例を示す図。
[図 7]短冊 22を説明するための説明図。
[図 8]ピンボケのみ対処モード(S3)の処理の流れを示すフローチャート。
[図 9]第 1中間値を算出するためのグラフ。
[図 10]第 2中間値を算出するためのグラフ。
[図 11]第 2中間値を算出するためのグラフ。
[図 12]被写体 H力 発せられた光子が撮像素子面 Sに到達する様子を説明するため の説明図。
[図 13]手ブレボケの発生を説明するための説明図。
[図 14]ピンボケの発生を説明するための説明図。
[図 15]撮像素子 (X, y)が受け止める光子の総数を説明するための説明図。
[図 16]あるメッシュ中に含まれる全ピクセルについて〔対隣接ピクセル明度差〕の度数 分布を示す度数分布表。
[図 17]ピンボケ.手ブレ双方対処モード(S4)の処理の流れを示すフローチャート。
[図 18]〔拡散率設定の元データ ·表〕を示す図。
発明を実施するための最良の形態
[0009] 以下、本発明の実施例に係る画像処理装置及び画像処理プログラムについて図 面に基づいて説明する。図 1は、本実施例に係る画像処理装置 1の構成を示すプロ ック図である。本画像処理装置 1は、修正すべき原画像の画像データを入力するた めのメディアリーダ (原画像入力手段) 2と入力された原画像に基づ ヽてこれを先鋭 化した新画像を生成するコンピュータ 3と、生成された新画像をプリントアウトするため の写真プリンタ 4と、を備えてなるものである。
[0010] メディアリーダ 2は、メモリカード, CD等の各種記憶媒体に記憶された原画像デー タを読み取ってコンピュータ 3に入力するためのものである。もちろん、本発明にかか る原画像入力手段として、本実施例のメディアリーダ 2に代えて従来公知のイメージ スキャナ等を用いることにより、プリント済みの写真画像力 画像データを読み取るこ とも可能である。
[0011] コンピュータ 3は、メディアリーダ 2から入力された原画像データを記憶する画像メモ リ 5と、画像先鋭ィ匕のための画像処理プログラム 6を格納するハードディスク 7と、該ハ ードディスク 7から読み出された画像処理プログラム 6を一時記憶する RAM (Randa om Access Memory) 8と、この画像処理プログラム 6に従って原画像データを先 鋭化処理する CPU (Central Processing Unit) 9と、原画像や先鋭化処理後の 画像を表示するための表示部 10と、マウスやキーボード等で構成される操作部 11と 、がシステムノ ス 12を介して接続されてなるものである。尚、先鋭化処理後の画像を ハードディスク 7に格納することも可能である。
[0012] 以下、本発明に係る画像処理プログラム 6のアルゴリズムにつ 、て説明する。本画 像処理プログラム 6は、種々のプログラミング言語を用いて作成され、原画像データ に基づ!/、てピンボケや手ブレがまったく発生しな 、時の理想像を近似的に算出する ものである。
[0013] 図 2は、画像処理プログラム 6の処理の流れを示すフローチャートである。画像処理 プログラム 6では、まず、入力された原画像に対して手ブレ状況推測処理 (S 1)が実 行される。その結果、原画像に手ブレが発生していないと判断した場合は(S2 : No) 、ピンボケのみ対処モードが実行される(S3)。一方、手ブレが発生していると判断し た場合は(S2 : Yes)、ピンボケ'手ブレ双方対処モードが実行される(S4)。以下、各 処理について詳細に説明する。尚、原画像についての手ブレの存否は、手ブレ状況 推測処理 (SI)に基づいた判断 (S2)によることなぐ使用者自身が原画像を見て手 ブレの存否を判断した上で、ピンボケのみ対処モード(S3)とピンボケ.手ブレ双方対 処モード (S4)の 、ずれかを選択することも可能である。
[0014] まず、手ブレ状況推測処理 (S1)について説明する。手ブレ状況推測処理 (S1)は 、入力された原画像データを解析することにより、撮影時に生じた手ブレ方向である〔 ブレ方向〕と、そのピクセル数である〔ブレビクセル数〕を推測する処理である。より詳 細に説明すると、被写体力 発せられてデジタルカメラのある 1つの撮像素子によつ て受け止められるはずであった光子は、手ブレが発生すると、その撮像素子に対して 手ブレ方向とは逆方向に位置する撮像素子によっても受け止められる。これにより、 原画像には、明度等の属性が接近して 、るピクセルが所定方向に連続した短冊状の 部分が生じる。本発明では、原画像に生じたこの短冊部分を解析することにより、〔ブ レ方向〕と〔ブレビクセル数〕を推測する。尚、以降においては、注目属性としてピクセ ルの明度を使用した場合を説明するが、色相や彩度や輝度といった他の属性を使用 した場合もこれと同様の手順となる。
[0015] 手ブレ状況推測処理 (S1)では、まず、原画像に含まれる全ピクセルについて、周 囲 8方向に隣接するピクセル、すなわち左,右,上,下,左上,右上,左下,及び右下 の計 8方向に隣接する各ピクセルとの明度差を調べ、その絶対値をそれぞれ記録し ていく。図 3及び図 4は、中央に位置する対象ピクセル 13と周囲 8方向に隣接するピ クセルとの明度差の一例を示す図である。尚、図中で斜線が施されたピクセルは対 象ピクセル 13との明度差が所定の閾値より小さいピクセルを意味し、図中で黒く塗り つぶされたピクセルは対象ピクセル 13との明度差が所定の閾値より大きいピクセルを 意味している。尚、本実施例では、この閾値を 0. 05としている力 適宜設定変更が 可能である。ここで、図 3 (a)に示すように、対象ピクセル 13が、左右両隣のピクセル 1 4, 15と明度がほとんど同じであって、それ以外の隣接ピクセルとは明度がある程度 異なる場合や、図 3 (b)及び図 3 (c)に示すように、対象ピクセル 13が左右いずれか 一方の隣接ピクセル 14, 15と明度がほとんど同じであって、それ以外の隣接ピクセ ルとは明度がある程度異なる場合、対象ピクセル 13は水平方向に平坦性があると判 断する。 [0016] 同様に、図 4 (a)に示すように、対象ピクセル 13が、上下両隣のピクセル 16, 17と 明度がほとんど同じであって、それ以外の隣接ピクセルとは明度がある程度異なる場 合や、図 4 (b)及び図 4 (c)に示すように、対象ピクセル 13が上下いずれか一方の隣 接ピクセル 16, 17と明度がほとんど同じであって、それ以外の隣接ピクセルとは明度 力 Sある程度異なる場合、対象ピクセル 13は上下方向に平坦性があると判断する。
[0017] また、図 5及び図 6は、対象ピクセル 13と周囲 8方向に隣接するピクセルとの明度差 について他の例を示す図である。尚、図中では斜線が施されたピクセルは対象ピク セル 13との明度差が所定の閾値より小さいピクセルを、黒く塗りつぶされたピクセル は対象ピクセル 13との明度差が所定の閾値より大きいピクセルを、白く塗りつぶされ たピクセルは対象ピクセル 13との明度差を問わな 、ピクセルをそれぞれ意味して ヽ る。ここで、図 5 (a)に示すように、対象ピクセル 13が左下隣及び右上隣の両ピクセル 18, 19と明度がほとんど同じであって、それ以外の隣接ピクセルとは明度がほとんど 同じであるとは言えない場合や、図 5 (b)及び図 5 (c)に示すように、対象ピクセル 13 が左下又は右上のいずれか一方の隣接ピクセル 18, 19と明度がほとんど同じであつ て、それ以外の隣接ピクセルとは明度がほとんど同じであるとは言えない場合、対象 ピクセル 13は左下一右上方向に平坦性があると判断する。
[0018] 同様に、図 6 (a)に示すように、対象ピクセル 13が左上隣及び右下隣の両ピクセル 20, 21と明度がほとんど同じであって、それ以外の隣接ピクセルとは明度がほとんど 同じであるとは言えない場合や、図 6 (b)及び図 6 (c)に示すように、対象ピクセル 13 が左上又は右下のいずれか一方の隣接ピクセル 20, 21と明度がほとんど同じであつ て、それ以外の隣接ピクセルとは明度がほとんど同じであるとは言えない場合、対象 ピクセル 13は左上一右下方向に平坦性があると判断する。
[0019] また、図に詳細は示さないが、対象ピクセル 13と周囲 8方向に隣接するピクセルと の明度差が図 3乃至図 6のいずれにも該当しない場合、対象ピクセル 13は平坦性が ないと判断する。
[0020] 次に、全ピクセルの平坦性に関する調査結果に基づいて、原画像上における短冊 部分の存否及びその方向を調査する。すなわち、図 7 (a) , (b) , (c)に示すように、 同方向への平坦性を有するピクセルが連続する場合にこれを短冊 22と判断し、図に 詳細は示さないが、水平,垂直,左下一右上,及び左上一右下の各方向ごとに、何 ピクセル分の短冊 22が何個形成されたかを示す度数分布表をそれぞれ作成する。
[0021] 次に、作成された度数分布表を元に、各方向毎に短冊 22の平均長さを算出する。
但し、その長さが 2ピクセルより短い短冊 22と、所定の上限値より長い短冊 22につい ては、平均長さの算出対象から除外した。これは、 2ピクセルより短いものは、実質上 短冊 22を形成しているとは言えないからであり、また、上限値より長いものは、手ブレ によって生じた短冊 22部分ではなぐ被写体上に実在する明度が接近しているピク セルが連続した部分の可能性が高いからである。尚、本実施例では前記上限値を 8 ピクセルとしたが、適宜設定変更が可能である。
[0022] 次に、各方向毎に算出された短冊 22の平均長さに基づいて、〔ブレ方向〕を推測す る。〔ブレ方向〕の推測は、短冊 22が最も多く形成された方向を調べ、その方向を〔ブ レ方向〕と決定することにより行う。より詳細には、各方向毎に算出された短冊 22の平 均長さのうち、水平方向の平均短冊長さと垂直方向の平均短冊長さを比較し、水平 方向の平均短冊長さが垂直方向の平均短冊長さ以上である場合には、以下の式(1 )により、〔水平一垂直短冊分布比〕を算出する。一方、水平方向の平均短冊長さが 垂直方向の平均短冊長さより小さい場合には、以下の式 (2)により、〔水平一垂直短 冊分布比〕を算出する。
[数 1] 水平-垂直短冊分布比
=水平方向'平均短冊長さノ垂直方向'平均短冊長さ 式 )
[数 2] 水平-垂直短冊分布比
=垂直方向'平均短冊長さノ水平方向'平均短冊長さ 式(2)
[0023] また、各方向毎に算出された短冊 22の平均長さのうち、左下一右上方向の平均短 冊長さと左上一右下方向の平均短冊長さを比較し、左下一右上方向の平均短冊長 さが左上一右下方向の平均短冊長さ以上である場合には、以下の式 (3)により、〔斜 め短冊分布比〕を算出する。一方、左下一右上方向の平均短冊長さが左上一右下 方向の平均短冊長さより小さい場合には、以下の式 (4)により、〔斜め短冊分布比〕を 算出する。
[数 3] 斜め ·短冊分布比
=左下一右上方向'平均'短冊長さ Z左上一右下方向 '平均.短冊長さ. . .式(3) 画 斜め ·短冊分布比
=左上一右下方向'平均短冊長さ 左下一右上方向.平均短冊長さ. . .式(4)
[0024] このように〔水平一垂直短冊分布比〕と〔斜め短冊分布比〕を算出した後、両者を比 較して、〔水平一垂直短冊分布比〕が〔斜め短冊分布比〕以上であって、且つ、水平 方向の平均短冊長さが垂直方向の平均短冊長さ以上である場合には、〔ブレ方向〕 を水平方向に決定する。一方、〔水平一垂直短冊分布比〕が〔斜め短冊分布比〕以上 であって、且つ、水平方向の平均短冊長さが垂直方向の平均短冊長さより小さい場 合には、〔ブレ方向〕を垂直方向に決定する。
[0025] また、〔水平一垂直短冊分布比〕が〔斜め短冊分布比〕より小さぐ且つ、左下一右 上方向の平均短冊長さが左上一右下方向の平均短冊長さ以上である場合には、〔 ブレ方向〕を左下一右上方向に決定する。一方、〔水平一垂直短冊分布比〕が〔斜め 短冊分布比〕より小さぐ且つ、左下一右上方向の平均短冊長さが左上一右下方向 の平均短冊長さより小さい場合には、〔ブレ方向〕を左上一右下方向に決定する。
[0026] 次に、〔ブレビクセル数〕を推測する。すなわち、〔ブレ方向〕が水平方向の場合は〔 ブレビクセル数〕を水平方向の平均短冊長さに決定し、〔ブレ方向〕が垂直方向の場 合は〔ブレビクセル数〕を垂直方向の平均短冊長さに決定する。また、〔ブレ方向〕が 左下一右上方向の場合は〔ブレビクセル数〕を左下一右上方向の平均短冊長さに決 定し、〔ブレ方向〕が左上一右下方向の場合は〔ブレビクセル数〕を左上一右下方向 の平均短冊長さに決定する。
[0027] 次に、〔ブレ方向に関する確信度〕を算出する。前述のように、〔ブレ方向〕の推測に 際しては、短冊 22が最も多く形成された方向を〔ブレ方向〕としたが、それが圧倒的 多数を占めたものであったのか、それとも僅少差で最も多く形成された方向とされた のかによってその確信度が異なる。従って、本発明では、〔ブレ方向〕の推測にどの 程度の確信度があるかを示す係数として、〔ブレ方向に関する確信度〕を導入して ヽ る。この〔ブレ方向に関する確信度〕は、以下の式(5)によって算出される。ここで、式 (5)における〔多数派勢力指数〕としては、〔ブレ方向〕が水平方向または垂直方向の 場合は〔水平一垂直短冊分布比〕を、〔ブレ方向〕が左下一右上方向または左上一右 下方向の場合は〔斜め短冊分布比〕をそれぞれ用いる。
[数 5]
[ブレ方向に関する確信度] =
(
1.0
I
(1.0
+
( 100.0
*
exp
(
( ( - 1.0 ) * [多数派勢力指数] ) 式(5)
)
)
)
)
[0028] 次に、〔グループ化可能ピクセルの多少に起因しての確信度〕を算出する。前述の ように、〔ブレ方向〕の決定に際しては、短冊 22が最も多く形成された方向を〔ブレ方 向〕としたが、原画像中に多くの短冊 22が形成された状態において最も多く形成され た方向を〔ブレ方向〕として決定した場合と、短冊 22を形成し得るピクセルがほとんど なぐほんの僅かの個数の短冊 22が形成されただけの状態において最も多く形成さ れた方向を〔ブレ方向〕として決定した場合とではその確信度が異なる。従って、本発 明では、〔ブレ方向〕の推測にどの程度の確信度があるかを示す係数として、〔ブレ方 向に関する確信度〕とは別に、〔グループィ匕可能ピクセルの多少に起因しての確信度 〕を導入している。
[0029] この〔グループィ匕可能ピクセルの多少に起因しての確信度〕の算出に際しては、ま ず、〔多数派形成'ピクセル数'割合〕を以下の式 (6)によって算出する。ここで、式 (6 )における〔多数派形成'ピクセル数〕としては、〔ブレ方向〕が水平方向の場合は、原 画像中で水平方向に平坦性を有するピクセルの数を、〔ブレ方向〕が垂直方向の場 合は、原画像中で水平方向に平坦性を有するピクセルの数を、〔ブレ方向〕が左下一 右上方向の場合は、原画像中で左下一右上方向に平坦性を有するピクセルの数を 、〔ブレ方向〕が左上一右下方向の場合は、左上一右下方向に平坦性を有するピク セルの数を、それぞれ採用する。
[数 6]
〔多数派形成'ピクセル数'割合〕
=〔多数派形成■ピクセル数〕ノ原画像の総ピクセル数 式(6) そして、以下の式(7)によって〔グループ化可能ピクセルの多少に起因しての確信 度〕を算出する。
[数 7]
[グループ化可能ピクセル数の多少に起因しての確信度; ) =
(
1.0
I
( 1.0
+
( 20.0
*
exp
(
( ( - 1.0 )
*
( 200
[多数派形成'ピクセル数'割合] 式 (7)
) [0031] 最後に、〔総合判定'確信度〕を算出する。この〔総合判定'確信度〕は、〔ブレ方向〕 の推測にどの程度の確信度があるかを示す係数として算出した〔ブレ方向に関する 確信度〕と〔グループィ匕可能ピクセルの多少に起因しての確信度〕を用いて、以下の 式 (8)によって算出することができる。
[数 8]
[総合判定 ·確信度] =
0.98
*
(
[グループ化可能ピクセルの多少に起因しての確信度] 式(8)
[ブレの方向に関する確信度]
)
[0032] 以上説明したように、原画像に対して手ブレ状況推測処理が実行された結果、〔ブ レ方向〕, 〔ブレビクセル数〕,及び〔総合判定'確信度〕の 3つの情報が出力され、こ れらの情報に基づいて後述する 2次元正規分布扁平化処理が実行されるものとなつ ている。
[0033] 次に、図 2に示すピンボケのみ対処モード(S3)について説明する。図 8は、ピンボ ケのみ対処モード(S3)の処理の流れを示すフローチャートである。本画像処理プロ グラム 6は、後述するように、被写体から発せられた光子が 2次元正規分布に従って 拡散するとの前提の下、原画像に対して先鋭ィ匕処理を実行するものである。ピンボケ のみ対処モード (S3)では、 2次元正規分布のパラメータである標準偏差 σが最適値 に設定され、その上で原画像に対して先鋭ィ匕処理が実行されるものとなって ヽる。
[0034] 図 8に示すように、ピンボケのみ対処モード (S3)の開始に伴い、まず、標準偏差 σ を上限値に設定して原画像に対して先鋭化処理を実行する(S5)。本発明では、 2次 元正規分布のパラメータである標準偏差 σとして、実用上の上限値と下限値を予め 定めている。ここで、上限値とは、それ以上標準偏差 σが大きくなると、画像の先鋭 度は増すものの、画像のザラツキが著しくなつて見るに耐えない状態となる限界値で ある。一方、下限値とは、それ以下に標準偏差 σが小さくなると、先鋭ィ匕の効果が得 られないか或いは画像が異常な状態になってしまう限界値である。本実施例では、 多数の画像に対して標準偏差 σを種々に変化させて先鋭ィ匕を行った結果、上限値 を 0. 7に、下限値を 0. 3にそれぞれ設定している。もちろん、画像のザラツキ感は見 る側の個人差等に影響を受けるため、本実施例に限定されず適宜設定変更が可能 である。尚、先鋭ィ匕処理の詳細については後述するため、ここでは説明を省略する。
[0035] そして、先鋭化処理後の画像につ!、て、ザラツキ度計測処理を実行する(S6)。ここ では、計測されたザラツキ度を〔ザラツキ度'標準偏差 ·上限値設定〕と定義し、これを 目安ザラツキ度(閾値)と比較する(S7)。この目安ザラツキ度は、ザラツキ度がこの程 度の大きさになれば良好な先鋭ィ匕の効果が得られるというザラツキ度の目安値であ つて、本実施例ではこの目安ザラツキ度を 30に設定している。もちろん、この目安ザ ラツキ度も適宜設定変更が可能である。そして、〔ザラツキ度 ·標準偏差 ·上限値設定 〕が目安ザラツキ度より小さ 、場合には (S7: Yes)、標準偏差 σを上限値に設定して 原画像に先鋭ィ匕処理を行い (S8)、先鋭ィ匕処理後の画像を最終結果として出力した 後、処理を終了する。このように、標準偏差 σを上限値に設定して最も強い先鋭ィ匕処 理を行っても、先鋭ィ匕処理後の画像のザラツキ度が目安ザラツキ度に達しない場合 には、標準偏差 σの最適値として上限値を採用する。尚、ザラツキ度計測処理の詳 細についても後述するため、ここでは説明を省略する。
[0036] 一方、〔ザラツキ度 ·標準偏差 ·上限値設定〕が、目安ザラツキ度より大きい場合には
(S7 : No)、標準偏差 σを下限値に設定して原画像に対して先鋭化処理を実行する (S9)。そして、先鋭ィ匕処理後の画像について、ザラツキ度計測処理を実行する(S1 0)。ここでは、計測されたザラツキ度を、〔ザラツキ度'標準偏差 '下限値設定〕と定義 し、これを目安ザラツキ度と比較する(Sl l)。そして、〔ザラツキ度 ·標準偏差 ·下限値 設定〕が目安ザラツキ度より大き!、場合には (S 11: Yes)、標準偏差 σを下限値に設 定して原画像に先鋭化処理を行い(S 12)、先鋭ィヒ処理後の画像を最終結果として 出力した後、処理を終了する。このように、標準偏差 σを下限値に設定して最も弱い 先鋭ィ匕処理を行っても、先鋭ィ匕処理後の画像のザラツキ度が目安ザラツキ度を越え てしまう場合には、標準偏差 σの最適値として下限値を採用する。この場合でも、下 限値は、先鋭ィ匕処理の前後で画像にほとんど差が生じない程度の大きさに設定され ているため、標準偏差 σを下限値に設定することで画像が見るに耐えない状態にな ることはない。
[0037] また、〔ザラツキ度,標準偏差,下限値設定〕が目安ザラツキ度より小さい場合には( Sl l :No)、標準偏差 σの第 1中間値を算出する (S13)。この第 1中間値とは、上限 値と下限値の間に、最適値に程々に近い値として暫定的に設定されるものである。こ の第 1中間値を算出するには、まず、図 9に示すように、 X軸に標準偏差 σを Y軸に ザラツキ度を取ったグラフを作成し、このグラフ上に、(上限値, 〔ザラツキ度'標準偏 差'上限値設定〕) P1と (下限値, 〔ザラツキ度'標準偏差 ·下限値設定〕 ) Ρ2の 2点を それぞれプロットする。そして、この 2点を通過する直線 Αを引き、目安ザラツキ度を 示す直線 Bである Y= 30との交点 P3について、その交点座標を算出し X座標を第 1 中間値と決定する。次に、標準偏差 σをこの第 1中間値に設定して原画像に対して 先鋭ィ匕処理を実行する(S 14)。そして、先鋭ィ匕処理後の画像についてザラツキ度計 測処理を実行する(S 15)。ここでは、計測されたザラツキ度を〔ザラツキ度 ·標準偏差 ,第 1中間値設定〕と定義する。
[0038] 次に、標準偏差 σの第 2中間値を算出する (S16)。この第 2中間値とは、第 1中間 値より更に最適値に近い値であって、下限値と第 1中間値の間、又は第 1中間値と上 限値の間に設定されるものである。この第 2中間値の算出方法は、〔ザラツキ度'標準 偏差 ·第 1中間値設定〕が目安ザラツキ度より大き!ヽか小さ!ヽかによつて 2通りに分類 される。まず、〔ザラツキ度 ·標準偏差 ·第 1中間値〕が目安ザラツキ度より大きい場合 、図 10に示すように、 X軸に標準偏差 σを Y軸にザラツキ度を取ったグラフを作成し 、このグラフ上に、(第 1中間値, 〔ザラツキ度'標準偏差 '第 1中間値設定〕) Ρ3と、 ( 下限値, 〔ザラツキ度 ·標準偏差 ·下限値設定〕) Ρ2の 2点をプロットする。そして、この 2点を通過する直線 Cと、目安ザラツキ度を示す直線 Βである Υ= 30との交点 Ρ4につ いて、その交点座標を算出し X座標を標準偏差 σの第 2中間値と決定する。
[0039] 一方、〔ザラツキ度 ·標準偏差 '第 1中間値設定〕が目安ザラツキ度より小さい場合、 図 11に示すように、 X軸に標準偏差 σを Υ軸にザラツキ度を取ったグラフを作成し、 このグラフ上に、(第 1中間値, 〔ザラツキ度'標準偏差 '第 1中間値設定〕) Ρ3と、(上 限値, 〔ザラツキ度'標準偏差 ·上限値設定〕) P1の 2点をプロットする。そして、この 2 点を通過する直線 Dと、目安ザラツキ度を示す直線 Βである Υ= 30との交点 Ρ5につ いて、その交点座標を算出し X座標を標準偏差 σの第 2中間値と決定する。最後に、 図 8に示すように、標準偏差 σを第 2中間値に設定して原画像に対して先鋭化処理 を実行し (S17)、先鋭ィ匕処理後の画像を最終結果として出力した後、処理を終了す る。
[0040] このように、標準偏差 σが下限値力 上限値へと変化するに連れてザラツキ度が線 形的に変化すると仮定し、ザラツキ度が目安ザラツキ度となる標準偏差 σ値を第 1中 間値として算出した上で、実際に標準偏差 σをその中間値に設定して先鋭ィ匕処理を 行ってその画像のザラツキ度を計測し、ザラツキ度が目安ザラツキ度に更に近付くよ うな第 2中間値を算出する、という手順により標準偏差 σの最適値を近似計算してい る。尚、本実施例では標準偏差 σの最適値として第 2中間値を採用しているが、更に 下限値と第 2中間値の間、或いは第 2中間値と上限値の間に第 3中間値を算出して これを最適値として採用することも可能である。また、同様の手順で第 4中間値、第 5 中間値 · ·と算出してこれを最適値として採用することも可能である。
[0041] 以下、図 8に示すピンボケのみ対処モード(S3)における先鋭化処理(S5, S8, S9 , S12, S14, S17)〖こついて説明する。先鋭ィ匕処理(S5, S8, S9, S12, S14, S1 7)の説明に先立って、まず、デジタルカメラにおけるピンボケや手ブレボケの発生メ 力-ズムについて説明する。一般に、デジタルカメラの内部には、光を受けると電気 的に反応する素子 (以下、「撮像素子」という)が設けられており、撮影しょうとする物 体 (以下、「被写体」 、う)の表面力 発せられた光の粒である光子力 デジタルカメ ラのシャッターが開いている間に、カメラ内部の撮像素子に到達することより、被写体 に応じた像が形成される。これにより、デジタルカメラによる被写体の撮影が可能とな つている。本発明では、図 12に示すように、被写体 Hの表面を格子状に分割して、各 格子内に位置する被写体 Hの所定部分を被写体 (X, y)と表し、被写体 (X, y)の部 分力も発せられた全ての光子のうち、デジタルカメラの撮像素子面 Sまで到達した光 子の数すなわち光の量を、出力光量—被写体 (X, y)と表すこととする。一方、デジタ ルカメラの撮像素子面 Sは、被写体の分割数と同数の撮像素子が整列してできたも のとし、撮像素子の所定部分を撮像素子 (X, y)と表し、撮像素子 (X, y)の部分が受 け取った光子の数すなわち光の量を、入力光量—撮像素子 (X, y)と表すこととする [0042] ここで、下記の式(9)のような理想的な条件が完全に整った時、すなわち、被写体( X, y)力 発せられてデジタルカメラの撮像素子面 Sまで到達した光子の全てが唯 1 個の撮像素子 (X, y)によって受け止められ、それ以外の撮像素子によって受け止め られた光子が 1個もない時、撮像素子面 Sには被写体 Hと全く同一の像が形成され、 ピンボケ.手ブレボケが全く発生しないピンボケ及び手ブレボケ.ゼロ状態の写真を撮 ることがでさる。
[数 9] 入力光量撮像素子 (; c, ) =出力光量被写体 ( ) 式(9)
[0043] しかし、現実の写真撮影においては、レンズの性能限界や、シャッターが開いてい る間に撮影者がカメラを動力してしまったり(手ブレ)、被写体 Hに焦点距離が合って いない (ピンボケ)等の事情により、式 (9)が完全に成り立つことはなぐ被写体 (X, y) 力も発せられてデジタルカメラの撮像素子面 Sまで到達した光子の一部は、撮像素 子 (X, y)以外の撮像素子によって受け止められる。例えば、手ブレが生じた場合、図 13に示すように、撮像素子まで到達した光子の一部は、撮像素子 (X, y)に対して手 ブレ方向とは逆方向に位置する撮像素子によって受け止められ、これにより手プレボ ケが発生する。また、被写体 Hに焦点距離が合っていない場合、図 14に示すように、 撮像素子まで到達した光子の一部は、四方八方に拡散して撮像素子 (X, y)の周囲 の撮像素子によって受け止められ、これによりピンボケが発生する。
[0044] このようにしてピンボケ ·手ブレボケが生じた原画像力もボケのな!、理想像を求める ベぐ本発明に係る画像処理プログラム 6では、光子の拡散率が適宜設定されている 。表 1は、光子の拡散率の一例を示すテーブルである。この場合、被写体 (X, y)から 撮像素子面 Sまで到達した光子のうち、約 40%が撮像素子 (X, y)によって受け止め られ、約 10%が撮像素子 (X, y- 1) ,撮像素子 (X, y+ 1) ,撮像素子 (x—l , y) ,撮 像素子 (x+ 1, y)によってそれぞれ受け止められ、約 5%が撮像素子 (x—l , y- 1) ,撮像素子 (x—l , y+ 1) ,撮像素子 (x+ 1, y- 1) ,撮像素子 (x+ 1, y+ 1)によつ て受け止められることを意味している。すなわち、被写体 (X, y)力も発せられた光子 が拡散する範囲は、撮像素子 (X, y)とこれを包囲するようにして隣接する計 9個の撮 像素子の範囲に限られ、それより外側の撮像素子の範囲へは拡散しないことを意味 している。
[表 1]
表 1 :光子の拡散率を示すテーブル
Figure imgf000017_0001
[0045] そして、光子の拡散率を表 1に示すように設定した場合、図 15に示すように、撮像 素子 (X, y)が受け止める光子の総数は、被写体 (X, y)とこれを包囲するようにして隣 接する計 9個の被写体格子から発せられた光子の合計となり、次の式(10)が成立す る。
[数 10] 入力光量—撮像素子 (X, ) =
出力光量—被写体 (X ,y )χ0.4
+出力光量—被写体 Oc- 1, )χ0.1
+出力光量—被写体 Oc + 1, )χ0.1
+出力光量—被写体 (X , -l)x0.1
+出力光量—被写体 (X , + l)x0.1
+出力光量—被写体 (χ-1,ァ -1)χ0.05
+出力光量—被写体 (X + 1,タ - 1) X 0.05
+出力光量—被写体 (X - 1 , + 1) X 0.05
+出力光量—被写体 (χ + 1, + 1)χ0.05 式(10)
[0046] ここで、式(10)における入力光量—撮像素子 (X, y)は、メディアリーダ 2から入力さ れた原画像データを参照することで全ての Xと yについて得られる既知の値であるた め、この既知の入力光量—撮像素子 (X, y)に基づいて、被写体 (X, y)から発せられ た全ての光子のうちデジタルカメラの撮像素子面 Sに到達した光子の総数である出 力光量—被写体 (X, y)を全ての Xと yについて求めることにより、撮影した被写体 Hの 正確な像を得ることができる。すなわち、ボケが生じている原画像に基づいて、ボケの な 、被写体 Hの正確な像を知ることができる。 [0047] 本画像処理プログラム 6では、被写体 Hや撮像素子面 Sの分割数を多くした場合で も、式(10)において、膨大な変数を含んだ連立方程式を解くことなぐ全ての Xと yに ついて出力光量—被写体 (X, y)を近似的に算出することを可能とすべぐ出力光量 _被写体 (X— 1, y)を入力光量 _撮像素子 (X— 1, y)に、出力光量 _被写体 (χ+ 1, y)を入力光量—撮像素子 (χ+1, y)に、出力光量—被写体 (X, y—l)を入力光 量 _撮像素子 (X, y—l)に、出力光量 _被写体 (X, y+1)を入力光量 _撮像素子 ( X, y+1)に、出力光量—被写体 (χ—1, ー1)を入カ光量—撮像素子 ー1, y- 1)に、出力光量 _被写体 (x+1, y— 1)を入力光量 _撮像素子 (x+1, y— 1)に、 出力光量 _被写体 (χ—1, 7+1)を入カ光量_撮像素子 ー1, y+1)に、出力光 量 _被写体 (x+1, y+1)を入力光量 _撮像素子 (x+1, y+1)に、それぞれ置換 して導出した以下の式(11)を用いて!/、る。
[数 11]
入力光量—撮像素子 ( =
出力光量—被写体 (X ,y )x0.4
+入力光量—撮像素子 (x-l,ァ )χ0.1
+入力光量 _撮像素子 (x + 1,ヌ )χ0.1
+入力光量 _撮像素子 (X , - 1)χ0·1
+入力光量一撮像素子 , + l)x0.1
+入力光量—撮像素子 -1)χ0.05
+入力光量—撮像素子 (X + 1, - 1) X 0.05
+入力光量—撮像素子 0 - 1 , + 1) X 0.05
+入力光量—撮像素子 + + 1)χ0.05 式(")
[0048] ここで、下記の式(12)のように定義する光総量'周囲分なる値を新たに導入するこ とにより式(11)を下記の式(13)のように書き直すことができる。
[数 12] 光総量 ·周囲分 =
入力光量—撮像素子 (x - l, ) x 0.1
+入力光量一撮像素子 (x + 1 , ) x 0.1
+入力光量—撮像素子 (X , - 1 ) χ 0.1
+入力光量—撮像素子 (X , + 1) χ 0.1
+入力光量—撮像素子 (X 1, - 1) X 0.05
+入力光量 _撮像素子 (X + 1 , — 1) X 0.05
+入力光量—撮像素子 0 _ 1, + 1) X 0.05
+入力光量一撮像素子 (X + 1,ヌ + 1) X 0.05 式( 1 2)
[数 13] 入力光量—撮像素子 ( ) =
出力光量—被写体 0, y) X 0.4
+光総量■周囲分 式(1 3 )
[0049] そして、式(13)を変形することによって、下記の式(14)を導くことができる。
[数 14] 出力光量 _被写体 (X, ) =
{入力光量—撮像素子 (χ, -光総量'周囲分 0.4 式(1 4) ここで、前述のように、入力光量 _撮像素子 (X, y)と光総量'周囲分とは、共に入 力された原画像データから得られる既知の値である。従って、前記 CPU9は、この式 (14)を用いて全ての Xと yについて出力光量—被写体 (X, y)を算出し、これに応じた 画像を新たに生成する。このように、ボケている原画像を修正するのではなぐボケて V、る原画像データに基づ!/ヽてボケがな!、状態での被写体 Hの理想像を近似的に算 出した上で、これに応じた新たな画像を生成することとしたので、膨大な数の変数を 含んだ連立方程式を解く必要がない分、処理時間を短縮することができ、且つ、高い 精度でボケを修正することができる。
[0050] 尚、光子の拡散率は表 1に限定されず任意の設定に変更することが可能であり、拡 散率の設定を変化させることにより、ボケの修正の度合いを強くし又は弱くするように 調整することができる。また、本実施例では被写体 (X, y)から発せられた光子が撮像 素子 (X, y)及びこれを包囲するように隣接する計 9個の撮像素子の範囲に拡散し、 それより外側の撮像素子の範囲には拡散しないものとして拡散率を設定したが、これ に限られず、例えば撮像素子 (x, y)の隣の隣の撮像素子、すなわち撮像素子 (X, y )を中心として 5 X 5 =計 25個あるいは 7 X 7 =計 49個の撮像素子の範囲に光子が 拡散するものとして拡散率を設定することも可能である。以下の表 2と表 3は、この場 合の拡散率の設定例を示したものであり、表 2はピンボケ修正の度合 ヽを強めにした 場合の設定例であって、表 3は表 2より修正の度合いを弱めにした場合の設定例を 示している。
[表 2] 表 2 :光子の拡散率を示すテーブル (ピンボケの修正度合いを強めに設定)
Figure imgf000020_0001
[表 3]
表 3 :光子の拡散率を示すテーブル (ピンボケの修正度合いを弱めに設定)
X一 2 x - ― 1 X X +- 1 x + 2 y-2 0 0 0. 0 0. 01 0. 0 0. 0 y-i 0 0 0. 04 0. 08 0. 04 0. 0 y 〇. 01 0. 08 0. 48 0. 08 0. 01 y + i 0 0 0. 04 0. 08 0. 04 0. 0 y + 2 0 0 0. 0 0. 01 0. 0 0. 0
[0051] 尚、上記説明では説明の便宜上、光子の拡散率を示すテーブルとして表 1,表 2, 及び表 3を例に挙げて説明したが、光子の拡散率を示すテーブルは任意に設定変 更が可能である。本発明では、表に詳細は示さないが、被写体から発せられた光子 力 ^次元正規分布に従って拡散するとの前提の下、光子の拡散率を示すテーブルを 設定している。これは、標準偏差という 1個のパラメータを制御するだけで、ピンボケ の修正度合いを強くし又は弱くするように自在に調整することができ、制御が容易だ 力もである。また、この場合の画像処理アルゴリズムは、式(14)を用いて行う点で前 述と同様であり、ここでは説明を省略する。
[0052] 一方、本画像処理プログラム 6は、光子の拡散率の設定を、ピンボケ修正の場合と 異なる設定とすることによって、手ブレボケの修正も行うことが可能となっている。表 4 は、手ブレボケ修正の場合の光子の拡散率の設定例であり、撮像素子 (X, y)の他に 、手ブレ方向とは逆方向に隣接する撮像素子 (X— 1, y)と、更にそれに隣接する撮 像素子 (X— 2, y)とが光子を受け止めることを示して 、る。
[表 4] 表 4 :光子の拡散率を示すテーブル (手ブレボケ修正の場合)
X - 2 x― 1 X X + 1 X + 2 y - 2 0 0 0 . 0 0 . 0 0 . 0 0 . 0 y — 1 0 0 0 . 0 0 . 0 0 . 0 0 . 0 y 0 2 0 . 3 0 . 5 0 . 0 0 . 0 y + i 0 0 0 . 0 0 . 0 0 . 0 0 . 0 y + 2 0 0 0 . 0 0 . 0 0 . 0 0 . 0 この場合、前記式(13)と同様に下記の式(15)が成立し、これを変形することで式( 16)に示すように出力光量—被写体 (X, y)を算出することができる。これにより、手ブ レボケした原画像データに基づ!/ヽて手ブレがな!/ヽ状態での被写体 Hの理想像を近 似的に算出した上で、これに応じた新たな画像を生成することにより、手ブレボケを 修正することができる。
[数 15] 入力光量一撮像素子 (χ, =
出力光量—被写体 (X, X 0.5
+光総量■周囲分 式(1 5)
[数 16] 出力光量一被写体 , ) =
{入力光量 _撮像素子 (X, -光総量'周囲分 0.5 式(1 6) このように、同じアルゴリズムを用いてピンボケと手ブレボケの双方を修正可能とした ことにより、画像に生じたボケがピンボケか手ブレボケかによつて修正のためのァルゴ リズムを使い分ける必要がなぐ処理が簡略化される。カロえて、ピンボケと手ブレボケ の双方が複合的に生じた画像でも、有効な先鋭ィ匕処理を行うことができるという利点 がある。 また、多画素化が進む近年のデジタルカメラで撮影した画像であって、被写体 Hか ら発せられた光子が撮像素子の広い範囲に渡って拡散することが想定される場合に は、本発明の適用に当たり、以下のような応用的な手法を用いることも可能である。 すなわち、修正すべき原画像上に、複数の画素を含んでなる所定大きさのメッシュを 設定する。このメッシュの大きさは、原画像の横方向と縦方向のそれぞれにメッシュ個 数が 1000個を超えないような大きさとする。そして、光子の拡散率を表 4に示すよう に設定する前提の下で式(14)を変更した式( 17)を用 、ることにより、被写体 Hの理 想像を近似的に算出する。尚、式 (17)中の {メッシュ中平均—入力光量—撮像素子 (m, n) }とは、原画像中の横方向に m番目、縦方向に n番目に位置するメッシュ (m, n)に注目し、その内部に存在する全ての撮像素子 (X, y)に対して {入力光量—撮像 素子 (X, y) }を調べ、それらの平均値を算出したものである。
[数 17]
出力光量—被写体 0 ,y )
={ 入力光量—撮像素子 Oc,
-メッシュ中平均—入力光量—撮像素子 m— ι,η ノ χθ.06
-メッシュ中平均—入力光量—撮像素子 m + \,n )x0.06
—メッシュ中平均—入力光量—撮像素子 m ,w— 1)χ0.06
-メッシュ中平均—入力光量—撮像素子 m ,« + l)x0.06
-メッシュ中平均—入力光量—撮像素子 w-l,«-l)x0.03
メッシュ中平均—入力光量一撮像素子 ; M + 1,«-1)X0.03
-メッシュ中平均—入力光量—撮像素子 m-l,« + l)x0.03
-メッシュ中平均—入力光量—撮像素子 m + l,n + l)x0.03
-メッシュ中平均—入力光量—撮像素子 m-2,n )x0.02
一メッシュ中平均—入力光量 撮像素子 m + 2,n )x0.02
-メッシュ中平均一入力光量—撮像素子 m ,«-2)x0.02
―メッシュ中平均—入力光量 _撮像素子 m ,n + 2)x0.02
-メッシュ中平均—入力光量 _撮像素子 w - 2,"— l)x0.015
-メッシュ中平均 入力光量—撮像素子 m + 2,n-l)xO.Q\5
-メッシュ中平均 入力光量一撮像素子 »¾-2,« + l)x0.015
-メッシュ中平均—入力光量 _撮像素子 m + 2,« + l)x0.015
-メッシュ中平均—入力光量 _撮像素子 OT-1,«-2)X0.015
-メッシュ中平均一入力光量 _撮像素子 m + l,«-2)x0.015
-メッシュ中平均—入力光量—撮像素子 m-l,« + 2)x0.015
-メッシュ中平均—入力光量 _撮像素子 m + l,« + 2)x0.015
-メッシュ中平均—入力光量—撮像素子 m-2,«-2)x0.007
-メッシュ中平均一入力光量—撮像素子 m-2,« + 2)x0.007
一メッシュ中平均 入力光量—撮像素子 m + 2, 7-2)x 0.007
-メッシュ中平均—入力光量撮像素子 w + 2,i7 + 2)x0.007
}÷ 0.412 式(1フ) 以下、図 8に示すピンボケのみ対処モード(S3)におけるザラツキ度計測処理 (S6, S10, S15)について説明する。一般に、画像の先鋭ィ匕に際しては、先鋭化の程度 が強くなるに従って、その画像は人の目力も見て荒れた感じすなわちざらついた感じ が強くなる。本発明では、この画像のざらついた感じを数値ィ匕すべぐ「ザラツキ度」 なる指数を導入している。このザラツキ度を計測するには、まず、対象となる画像を複 数のメッシュに分割する。本実施例では、このメッシュを一辺が 50ピクセルの正方形 領域としたが、もちろん任意の数のピクセルを含んだメッシュを設定可能である。そし て、ある 1つのメッシュ内に含まれる全ピクセルについて、所定方向に隣接するピクセ ルとの明度差である〔対隣接ピクセル明度差〕を計測する。ここで、隣接ピクセルとは 、画像データ上に隣り合って格納されたピクセルを意味するのではなぐ次のようにし て決定されるピクセルを意味している。すなわち、対象画像の横方向に格納されたピ クセル数と縦方向に格納されたピクセル数を比較して、 Vヽずれか大き 、方のピクセル 数を Kとした場合、その画像上のあるピクセル (X, y)の隣接ピクセルは、以下の式(1 8)と式(19)によって算出される Iを用いることにより、ピクセル (X— I, y)と表すことが できる。これは、あるピクセル (X, y)力も見て左方向に Iピクセルだけ離れた位置に格 納されたピクセルを意味している。尚、画像データ上における (I, y)よりも左側に位置 するピクセルについては、左側への隣接ピクセルが存在しないため、対隣接ピクセル の明度差の計測は行わない。また、隣接ピクセルとしては左方向に隣接したピクセル に限られず、任意の方向に隣接したピクセルを選択することが可能である。
[数 18]
J = KZ1 000 式(1 8)
[数 19]
I=J+ 1 式(1 9) そして、そのメッシュについて、図 16に示すように、横軸に 0. 1幅間隔で明度差を 表示し縦軸に度数を表示した度数分布表を作成する。その上で、明度差が 0. 1〜 + 0. 1の範囲の度数を合計したものを〔中心領域 *総度数〕と定義する一方、この中 心領域の外側に位置する領域、すなわち明度差が 0. 3〜一 0. 1の範囲と + 0. 1 〜+ 0. 3の範囲の度数を合計したものを、〔近中心領域 ·総度数〕と定義する。この場 合、当該メッシュのザラツキ度は、以下の式(20)によって表すことができる。また、度 数分布表の横軸は、 0. 1幅間隔に限られず任意の幅間隔とすることができる。
[数 20] ザラツキ度 = (近中心領域'総度数 Z中心領域'総度数 ) χ 100 式(20)
[0057] そして、これと同様にして、画像中に含まれる全てのメッシュについて、メッシュ中の 全ピクセルの〔対隣接ピクセル明度差〕を計測した上で度数分布表を作成することに より、ザラツキ度をそれぞれ計測する。その上で、 ^ッシュのザラツキ度のうち最大 値をその画像全体のザラツキ度として出力する。
[0058] また、対象画像のザラツキ度を計測する他の手段としては、画像をメッシュ分割する ことなく行う方法もある。この方法では、まず、対象画像について、最も左端に位置す るピクセルを除く全ピクセルにつ ヽて〔対隣接ピクセル明度差〕を計測する。その上で 、上記と同様にして、横軸に 0. 1幅間隔で明度差を表示し縦軸に度数を表示した度 数分布表を作成し、上記式 (20)を用いて画像全体としてのザラツキ度を直接算出す る。この方法によれば、画像をメッシュ分割する処理が不要となる分、処理時間を短 縮できるという利点がある。
[0059] 次に、図 2に示すピンボケ ·手ブレ双方対処モード(S4)について説明する。図 17 は、ピンボケ ·手ブレ双方対処モード(S4)の処理の流れを示すフローチャートである 。本画像処理プログラム 6は、前述のように、被写体から発せられた光子が 2次元正 規分布に従って拡散するとの前提の下、現画像に対して先鋭化処理を実行するもの である。ピンボケ ·手ブレ双方対処モード (S4)は、光子の拡散率の設定をピンボケの み対処モード (S3)とは異なる設定とすることによって、手ブレにも対処可能としたこと を特徴としている。このモードでは、まず 2次元正規分布扁平ィ匕処理 (S 18)が実行さ れた後、扁平ィ匕された 2次元正規分布に基づいてピンボケのみ対処モード (S3)が 実行される。このピンボケのみ対処モード(S3)の処理の流れは前述と同じであるた め、ここでは説明を省略する。
[0060] 2次元正規分布扁平化処理 (S18)では、まず、前記手ブレ状況推測処理 (S1)の 出力結果に基づいて、扁平ィ匕パラメータ値を算出する。扁平化パラメータ値とは、〔 扁平化処理の長軸方向角度〕, 〔長軸方向'倍率〕,及び〔短軸方向'倍率〕の 3つの 数値力もなるものであって、手ブレ状況推測処理 (S1)から出力される〔ブレ方向〕, 〔 ブレビクセル数〕 ,及び〔総合判定'確信度〕の 3つの情報に基づいて算出される。 [0061] 〔扁平化処理の長軸方向角度〕は〔ブレ方向〕により決定される。具体的には、〔ブレ 方向〕が水平方向の場合は〔扁平化処理の長軸方向角度〕が 0度に、〔ブレ方向〕が 垂直方向の場合は〔扁平ィ匕処理の長軸方向角度〕が 90度に、〔ブレ方向〕が左下一 右上方向の場合は〔扁平化処理の長軸方向角度〕が 45度に、〔ブレ方向〕が左上一 右下方向の場合は〔扁平化処理の長軸方向角度〕が 135度にそれぞれ設定される。
[0062] 〔長軸方向'倍率〕と〔短軸方向'倍率〕は、次の式 (21)と式 (22)により算出される。
ここで、式(21)中の〔長軸方向を短軸方向の何倍にするか〕は、〔ブレビクセル数〕と〔 総合判定'確信度〕を用いて次の式(23)により算出される。この式(23)によれば、〔 総合判定'確信度〕の変化に伴って〔長軸方向を短軸方向の何倍にするか〕が動的 に変化し、例えば、〔総合判定'確信度〕 =0の時は〔長軸方向を短軸方向の何倍に するカゝ〕 = 1. 0となり、〔総合判定'確信度〕 = .1. 0の時は〔長軸方向を短軸方向の 何倍にする力〕 =〔ブレビクセル数〕となる。
[数 21]
[長軸方向 ·倍率] = ι.οΖ [長軸方向を短軸方向の何倍にするか] 式 (2 1 )
[数 22] 短軸方向 ·倍率] = 1.0 式 (2 2 )
[数 23]
[長軸方向を短軸方向の何倍にする力、: 1 =
1.0
+
( 数]' 式 (2 3 )
1.0
[総合判定 *確信度]
[0063] 次に、〔拡散率設定の元データ'表〕を設定する。図 18は、〔拡散率設定の元データ •表〕を示す図である。〔拡散率設定の元データ'表〕を構成する各マス目には、図に 示すような座標がそれぞれ与えられている。この座標 (X, y)に対し、以下の式(24) 力も式(29)を用いて算出した〔マス目(X, y)に設定する値〕をそれぞれセットしていく
[数 24]
[回転角度] =0- [扁平化処理の長軸方向角度] 式(24)
[数 25] [回転後' ] =
x*cos( [回転角度] )
式(25)
*sin(〖 回転角度] )
[数 26]
[回転後 ·ί'] =
X* sin ([回転角度])
+ ■ (式 26)
* cos ([回転角度])
[数 27]
[伸張後 ' ] = [回転後 * [長軸方向'倍率]' 式(27)
[数 28]
[伸張後■ Y] = [回転後■ Y] * [短軸方向 ·倍率]'■ 式 (28)
[数 29] [拡散率設定の元データ■表'マス目 (χ, に設定する値] =
(1.0
I
(2.0*π (円周率) * [標準偏差])
)
( -1.0/2.0)
(
([伸張後 ]* [伸張後 ])
I
([標準偏差] * [標準偏差])
)
+
(
([伸張後 ·ίΊ* [伸張後 ])
I
([標準偏差] * [標準偏差])
)
、 (式 29)
[0064] そして、算出した〔拡散率設定の元データ〕を用いて、〔光子拡散率表〕の各マス目( X, y)に設定する値を次の式(30)により算出する。尚、式(30)における∑は、〔拡散 率設定の元データ'表 'マス目(X, y)に設定する値〕の全マス目に渡っての総合計を 意味している。
[数 30]
[光子拡散率表'マス目 (X, に設定する値] =
[拡散率設定の元データ '表 'マス目 (X, に設定する値]
I 式(30)
産業上の利用可能性
[0065] 本発明は、ピンボケ画像や手ブレ画像を先鋭な画像に修正する画像処理プロダラ ム及び画像処理装置に適用可能である。

Claims

請求の範囲
[1] 対象となる画像について手ブレの発生状況を推測する処理をコンピュータに実行さ せる手ブレ状況推測プログラムであって、
前記手ブレの発生状況を推測する処理は、対象となる画像を構成する複数の画素 について、色の属性に関し隣接する周囲の画素との差異を測定してその絶対値が所 定の閾値より小さい方向をその画素が平坦性を有する方向とし、同じ方向に平坦性 を有する連続した画素群を短冊として形成し、各方向毎に算出した短冊の平均長さ に基づ!/、て手ブレ方向を推測するとともに、その手ブレ方向に形成された短冊の平 均長さを手ブレ画素数と推測するものであることを特徴とする手ブレ状況推測プログ ラム。
[2] 前記短冊の平均長さが、所定の下限値より短い短冊と所定の上限値より長い短冊 を除外して算出されることを特徴とする請求項 1記載の手ブレ状況推測プログラム。
[3] 前記手ブレ方向の推測は、水平方向に延びる短冊の平均長さと垂直方向に延びる 短冊の平均長さとの比である水平一垂直短冊分布比を算出する一方、左下一右上 方向に延びる短冊の平均長さと左上一右下方向に延びる短冊の平均長さとの比で ある斜め短冊分布比を算出し、水平一垂直短冊分布比が斜め短冊分布比より大き い場合は、水平方向と垂直方向のうち短冊の平均長さが長い方向を手ブレ方向と推 測し、斜め短冊分布比が水平一垂直短冊分布比より大きい場合は、左下一右上方 向と左上一右下方向のうち短冊の平均長さが長い方向を手ブレ方向と推測するもの であることを特徴とする請求項 1又は 2に記載の手ブレ状況推測プログラム。
[4] 前記色の属性が、明度、彩度、色相、又は輝度のいずれかであることを特徴とする 請求項 1乃至 3のいずれかに記載の手ブレ状況推測プログラム。
[5] 請求項 1乃至 4の 、ずれかに記載の手ブレ状況推測プログラムが記録されたコンビ ユータ読み取り可能な記録媒体。
[6] 対象となる画像につ!ヽて手ブレの発生状況を推測する処理を実行する手ブレ状況 推測装置であって、
対象となる画像を構成する複数の画素について、色の属性に関し隣接する周囲の 画素との差異を測定する差異測定手段と、測定された差異の絶対値が所定の閾値よ り小さい方向をその画素が平坦性を有する方向と決定する平坦性決定手段と、同じ 方向に平坦性を有する連続した画素群を短冊として形成する短冊形成手段と、各方 向毎に短冊の平均長さを算出する平均短冊長さ算出手段と、算出された短冊の平 均長さに基づいて手ブレ方向を推測するとともに、その手ブレ方向に形成された短 冊の平均長さを手ブレ画素数と推測する手ブレ状況推測手段と、を備えることを特徴 とする手ブレ状況推測装置。
[7] 前記平均短冊長さ算出手段が、所定の下限値より短い短冊と所定の上限値より長 い短冊を除外して短冊の平均長さを算出することを特徴とする請求項 6記載の手ブ レ状況推測装置。
[8] 前記手ブレ状況推測手段による手ブレ方向の推測は、水平方向に延びる短冊の 平均長さと垂直方向に延びる短冊の平均長さとの比である水平一垂直短冊分布比 を算出する一方、左下一右上方向に延びる短冊の平均長さと左上一右下方向に延 びる短冊の平均長さとの比である斜め短冊分布比を算出し、水平一垂直短冊分布 比が斜め短冊分布比より大きい場合は、水平方向と垂直方向のうち短冊の平均長さ が長い方向を手ブレ方向と推測し、斜め短冊分布比が水平一垂直短冊分布比より 大きい場合は、左下一右上方向と左上一右下方向のうち短冊の平均長さが長い方 向を手ブレ方向と推測するものであることを特徴とする請求項 6又は 7に記載の手ブ レ状況推測装置。
[9] 前記色の属性が、明度、彩度、色相、又は輝度のいずれかであることを特徴とする 請求項 6乃至 8のいずれかに記載の手ブレ状況推測装置。
PCT/JP2006/315679 2006-06-08 2006-08-08 手ブレ状況推測プログラム及びこれが記録されたコンピュータ読み取り可能な記録媒体、ならびに手ブレ状況推測装置 WO2007141886A1 (ja)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
PCT/JP2006/311547 WO2007141863A1 (ja) 2006-06-08 2006-06-08 画像処理プログラム及びこれが記録されたコンピュータ読み取り可能な記録媒体、ならびに画像処理装置
JPPCT/JP2006/311547 2006-06-08

Publications (1)

Publication Number Publication Date
WO2007141886A1 true WO2007141886A1 (ja) 2007-12-13

Family

ID=38170214

Family Applications (3)

Application Number Title Priority Date Filing Date
PCT/JP2006/311547 WO2007141863A1 (ja) 2006-06-08 2006-06-08 画像処理プログラム及びこれが記録されたコンピュータ読み取り可能な記録媒体、ならびに画像処理装置
PCT/JP2006/315679 WO2007141886A1 (ja) 2006-06-08 2006-08-08 手ブレ状況推測プログラム及びこれが記録されたコンピュータ読み取り可能な記録媒体、ならびに手ブレ状況推測装置
PCT/JP2006/315680 WO2007141887A1 (ja) 2006-06-08 2006-08-08 ザラツキ度計測プログラム及びこれが記録されたコンピュータ読み取り可能な記録媒体、ならびにザラツキ度計測装置

Family Applications Before (1)

Application Number Title Priority Date Filing Date
PCT/JP2006/311547 WO2007141863A1 (ja) 2006-06-08 2006-06-08 画像処理プログラム及びこれが記録されたコンピュータ読み取り可能な記録媒体、ならびに画像処理装置

Family Applications After (1)

Application Number Title Priority Date Filing Date
PCT/JP2006/315680 WO2007141887A1 (ja) 2006-06-08 2006-08-08 ザラツキ度計測プログラム及びこれが記録されたコンピュータ読み取り可能な記録媒体、ならびにザラツキ度計測装置

Country Status (2)

Country Link
JP (1) JP3915037B1 (ja)
WO (3) WO2007141863A1 (ja)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000298300A (ja) * 1999-04-13 2000-10-24 Ricoh Co Ltd 手ぶれ画像補正方法、記録媒体及び撮像装置
JP2005122721A (ja) * 2003-09-25 2005-05-12 Fuji Photo Film Co Ltd 画像処理方法および装置並びにプログラム
JP2006019874A (ja) * 2004-06-30 2006-01-19 Fuji Photo Film Co Ltd 手ぶれ・ピンボケレベル報知方法および撮像装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61109182A (ja) * 1984-11-01 1986-05-27 Fujitsu Ltd 画像処理装置
JPH04157353A (ja) * 1990-10-19 1992-05-29 Komatsu Ltd ひび割れ画像データ処理方法
JPH07121703A (ja) * 1993-10-22 1995-05-12 Canon Inc 画像処理方法
JPH096962A (ja) * 1995-06-21 1997-01-10 Dainippon Screen Mfg Co Ltd 鮮鋭度の評価方法
JPH1139479A (ja) * 1997-07-16 1999-02-12 Dainippon Screen Mfg Co Ltd 鮮鋭度の評価方法
JP2000004363A (ja) * 1998-06-17 2000-01-07 Olympus Optical Co Ltd 画像復元方法
US7397953B2 (en) * 2001-07-24 2008-07-08 Hewlett-Packard Development Company, L.P. Image block classification based on entropy of differences

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000298300A (ja) * 1999-04-13 2000-10-24 Ricoh Co Ltd 手ぶれ画像補正方法、記録媒体及び撮像装置
JP2005122721A (ja) * 2003-09-25 2005-05-12 Fuji Photo Film Co Ltd 画像処理方法および装置並びにプログラム
JP2006019874A (ja) * 2004-06-30 2006-01-19 Fuji Photo Film Co Ltd 手ぶれ・ピンボケレベル報知方法および撮像装置

Also Published As

Publication number Publication date
JPWO2007141863A1 (ja) 2009-10-15
WO2007141887A1 (ja) 2007-12-13
WO2007141863A1 (ja) 2007-12-13
JP3915037B1 (ja) 2007-05-16

Similar Documents

Publication Publication Date Title
US7356254B2 (en) Image processing method, apparatus, and program
US7599568B2 (en) Image processing method, apparatus, and program
US9361680B2 (en) Image processing apparatus, image processing method, and imaging apparatus
US9779489B2 (en) Automatically suggesting regions for blur kernel estimation
JP4351911B2 (ja) デジタルスチルカメラにおける取り込み画像の写真品質を評価する方法及び装置
US8224116B2 (en) Image processing method and imaging apparatus
US9071754B2 (en) Image capturing apparatus, image processing apparatus, image processing method, and image processing program
JP4747163B2 (ja) 人物画像における赤目補正
US7792384B2 (en) Image processing apparatus, image processing method, program, and recording medium therefor
US10477128B2 (en) Neighborhood haze density estimation for single-image dehaze
US9692958B2 (en) Focus assist system and method
JP4415188B2 (ja) 画像撮影装置
US20200012908A1 (en) Image processing apparatus, image processing method, and non-transitory computer readable storage medium
TWI496105B (zh) 影像合成裝置及用於影像合成之電腦程式
JP5725194B2 (ja) 夜景画像ボケ検出システム
JP4515208B2 (ja) 画像処理方法および装置並びにプログラム
CN109934789A (zh) 图像去噪方法、装置及电子设备
WO2007141886A1 (ja) 手ブレ状況推測プログラム及びこれが記録されたコンピュータ読み取り可能な記録媒体、ならびに手ブレ状況推測装置
Simpkins et al. Robust grid registration for non-blind PSF estimation
CN109727193B (zh) 图像虚化方法、装置及电子设备
CN115239569A (zh) 图像暗角移除方法、全景图像生成方法和相关设备
JP2010079815A (ja) 画像補正装置
WO2007097054A1 (ja) 画像処理プログラム及びこれが記録されたコンピュータ読み取り可能な記録媒体、ならびに画像処理装置
JP2010010975A (ja) 写真画像処理方法、写真画像処理プログラム、及び写真画像処理装置
JP2011059147A (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: 06782505

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 06782505

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP