WO2014192642A1 - Image processing device and image processing method - Google Patents
Image processing device and image processing method Download PDFInfo
- Publication number
- WO2014192642A1 WO2014192642A1 PCT/JP2014/063648 JP2014063648W WO2014192642A1 WO 2014192642 A1 WO2014192642 A1 WO 2014192642A1 JP 2014063648 W JP2014063648 W JP 2014063648W WO 2014192642 A1 WO2014192642 A1 WO 2014192642A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- pixel
- reference image
- processing apparatus
- image processing
- Prior art date
- Legal status (The legal status 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 status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01C—MEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
- G01C3/00—Measuring distances in line of sight; Optical rangefinders
- G01C3/02—Details
- G01C3/06—Use of electric means to obtain final indication
- G01C3/08—Use of electric radiation detectors
- G01C3/085—Use of electric radiation detectors with electronic parallax measurement
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/80—Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
- G06T7/85—Stereo camera calibration
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/74—Image or video pattern matching; Proximity measures in feature spaces
- G06V10/75—Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
- G06V10/751—Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/10—Character recognition
- G06V30/24—Character recognition characterised by the processing or recognition method
- G06V30/248—Character recognition characterised by the processing or recognition method involving plural approaches, e.g. verification by template match; Resolving confusion among similar patterns, e.g. "O" versus "Q"
- G06V30/2504—Coarse or fine approaches, e.g. resolution of ambiguities or multiscale approaches
Definitions
- the present invention relates to an image processing apparatus and an image processing method, and more particularly to an image processing apparatus and an image processing method for searching for corresponding points.
- Patent Document 1 discloses a technique for reducing a parallax estimation error by detecting a deviation of an epipolar line.
- Patent Document 2 discloses a technique for searching for the most parallelized condition of epipolar lines by performing movement, rotation, magnification conversion, and the like.
- Patent Document 3 discloses a technique for searching for corresponding points in two stages: a coarse search and a fine search for nearby subjects.
- Patent Documents 1 to 3 improve the accuracy of the corresponding point search, they cannot meet the needs for higher speed.
- the present invention has been made in view of such problems, and an object thereof is to provide an image processing apparatus and an image processing method capable of searching for corresponding points at high speed and with high accuracy.
- an image processing apparatus uses, as a reference image, one input image in a group of multi-viewpoint input images each having a common partial area, An image processing apparatus for estimating a corresponding pixel in an input image other than the reference image, from a position corresponding to one pixel of the input image other than the reference image, By performing template matching at a first pitch in a direction corresponding to the direction formed by the viewpoint of the input image, a first estimation unit for estimating a pixel corresponding to the one pixel, and a first estimation unit A second estimation unit configured to estimate a pixel corresponding to the one pixel by performing template matching on the estimated pixel at a second pitch smaller than the first pitch.
- the second estimation unit performs template matching using a template having a size equal to or smaller than the size of the template used in the first estimation unit.
- the image processing apparatus is configured to estimate a shift amount in a decimal pixel based on a shift between the one pixel and a pixel corresponding to the one pixel estimated by the second estimation unit.
- the estimation part is further provided.
- a processing unit for executing processing for calculating a distance from the viewpoint of the reference image to the subject based on a shift between the one pixel and a pixel corresponding to the one pixel of the input image other than the reference image Is further provided.
- the processing unit calculates the distance from the viewpoint of the reference image to the subject by adding the deviations of each of the plurality of input images other than the reference image.
- the processing unit calculates a correction amount from a shift of each of the plurality of input images other than the reference image, and corrects each shift.
- the image processing apparatus performs super-resolution processing on an input image other than the reference image using a shift between the one pixel and a pixel corresponding to the one pixel of the input image other than the reference image as a parameter.
- a processing unit is further provided.
- the image processing apparatus further includes a preprocessing unit for performing distortion correction and parallelization processing as preprocessing for each of the input images.
- an image processing method uses, as a reference image, one reference image of a multi-viewpoint input image group having a common partial area, and a reference image of one pixel on the reference image.
- a method of estimating a corresponding pixel in an input image other than the reference image, and a direction formed by the viewpoint of the reference image and the viewpoint of the input image other than the reference image from the position corresponding to the one pixel of the input image other than the reference image By performing template matching at a first pitch in a direction corresponding to the above, and estimating a pixel corresponding to the one pixel, and a second pitch smaller than the first pitch with respect to the estimated pixel. Estimating a pixel corresponding to the one pixel by performing template matching.
- an image processing program causes a computer to use one input image of a multi-viewpoint input image group having a common partial area as a reference image, and one pixel on the reference image.
- the computer is caused to execute the step of estimating the pixel corresponding to the one pixel.
- FIG. 1 is a block diagram illustrating a basic configuration of an image processing apparatus according to an embodiment. It is a block diagram which shows the structure of the digital camera which actualized the image processing apparatus. It is a block diagram which shows the structure of the personal computer which actualized the image processing apparatus. It is the schematic showing the relationship between the lens contained in the camera which is an array camera, and the image pick-up element which is an image sensor. It is a figure showing the specific example of arrangement
- FIG. 25 is a diagram for describing a first example of a positional deviation estimation process in step S1 ′ of FIG. 24.
- FIG. 25 is a diagram for describing a second example of the positional deviation estimation process in step S1 ′ of FIG. 24. It is a figure showing the flow of the super-resolution process in step S5 of FIG. It is a figure for demonstrating the degradation information used by step # 33 of FIG.
- FIG. 25 is a diagram illustrating another example of super-resolution processing in step S5 of FIG. 24.
- 10 is a flowchart showing an operation flow in the image processing apparatus according to the third embodiment. It is a figure for demonstrating the synthetic
- step S7 of FIG. 10 is a flowchart illustrating an operation flow in an image processing apparatus according to a fourth embodiment. It is a figure for demonstrating the method to correct
- FIG. 1 is a block diagram showing a basic configuration of an image processing apparatus 1 according to the present embodiment.
- the image processing apparatus 1 includes an imaging unit 2, an image processing unit 3, and an image output unit 4.
- the image capturing unit 2 captures an image of a subject to acquire an image (hereinafter also referred to as “input image”), and the image processing unit 3 performs an operation on the acquired input image. Image processing as will be described later is performed. Then, the image output unit 4 outputs the image after image processing to a display device or the like.
- the imaging unit 2 captures an object (subject) and generates an input image. More specifically, the imaging unit 2 includes a camera 22 and an A / D (Analog to Digital) conversion unit 24 connected to the camera 22. The A / D converter 24 outputs an input image indicating the subject imaged by the camera 22.
- a / D Analog to Digital
- the camera 22 is an optical system for imaging a subject, and is an array camera. That is, the camera 22 includes N lenses 22a-1 to 22a-n having different viewpoints arranged in a lattice shape (these are also referred to as lenses 22a) and an image sensor (image sensor) 22b. .
- the A / D converter 24 converts a video signal (analog electrical signal) indicating a subject output from the image sensor 22b into a digital signal and outputs the digital signal.
- the imaging unit 2 may further include a control processing circuit for controlling each part of the camera.
- the image processing unit 3 includes a position shift estimation unit 32 for searching for corresponding points by performing a position shift estimation process, and a processing unit 33 for performing image processing to be described later.
- the image processing unit 3 includes a preprocessing unit 31 for executing distortion correction and parallelization processing as preprocessing for the input image.
- the misregistration estimation unit 32 includes a first estimation unit 321 for performing a “coarse” estimation process in the first stage of the process of estimating the misregistration amount in pixels (integer pixels), and the misalignment amount in pixel units. And a second estimation unit 322 for performing a second-stage estimation process in the process of estimating.
- the positional deviation estimation unit 32 further includes a third estimation unit 323 for performing a process of estimating the deviation amount in units of sub-pixels (decimal pixels).
- the image processing apparatus 1 shown in FIG. 1 can be configured as a system in which each unit is embodied as an independent apparatus.
- the image processing apparatus 1 may be embodied as a digital camera or a personal computer described below. Many. Therefore, as an implementation example of the image processing apparatus 1 according to the present embodiment, an implementation example with a digital camera and an implementation example with a PC (personal computer) will be described.
- FIG. 2 is a block diagram showing a configuration of a digital camera 100 that embodies the image processing apparatus 1 shown in FIG. 2, components corresponding to the respective blocks constituting the image processing apparatus 1 shown in FIG. 1 are denoted by the same reference numerals as those in FIG. 1.
- a digital camera 100 includes a CPU (Central Processing Unit) 102, a digital processing circuit 104, an image display unit 108, a card interface (I / F) 110, a storage unit 112, and a camera unit. 114.
- CPU Central Processing Unit
- I / F card interface
- the CPU 102 controls the entire digital camera 100 by executing a program stored in advance.
- the digital processing circuit 104 executes various digital processes including image processing according to the present embodiment.
- the digital processing circuit 104 is typically configured by a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an LSI (Large Scale Integration), an FPGA (Field-Programmable Gate Array), or the like.
- the digital processing circuit 104 includes an image processing circuit 106 for realizing the functions provided by the image processing unit 3 shown in FIG.
- the image display unit 108 includes an input image provided by the camera unit 114, an output image generated by the digital processing circuit 104 (image processing circuit 106), various setting information related to the digital camera 100, and a control GUI (Graphical User Interface) screen is displayed.
- GUI Graphic User Interface
- the card interface (I / F) 110 is an interface for writing image data generated by the image processing circuit 106 to the storage unit 112 or reading image data or the like from the storage unit 112.
- the storage unit 112 is a storage device that stores image data generated by the image processing circuit 106 and various types of information (setting values such as control parameters and operation modes of the digital camera 100).
- the storage unit 112 includes a flash memory, an optical disk, a magnetic disk, and the like, and stores data in a nonvolatile manner.
- the camera unit 114 generates an input image by imaging a subject.
- a digital camera 100 shown in FIG. 2 is obtained by mounting the entire image processing apparatus 1 according to the present embodiment as a single apparatus. That is, the user can visually recognize a high-resolution image on the image display unit 108 by imaging the subject using the digital camera 100.
- FIG. 3 is a block diagram showing a configuration of a personal computer 200 that embodies the image processing apparatus 1 shown in FIG.
- a personal computer 200 shown in FIG. 3 is obtained by mounting a part of the image processing apparatus 1 according to the present embodiment as a single apparatus.
- the imaging unit 2 for acquiring an input image is not mounted, and an input image acquired by an arbitrary imaging unit 2 is input from the outside. Even such a configuration can be included in the image processing apparatus 1 according to the embodiment of the present invention.
- components corresponding to blocks constituting the image processing apparatus 1 shown in FIG. 1 are denoted by the same reference numerals as those in FIG.
- the personal computer 200 includes a personal computer main body 202, a monitor 206, a mouse 208, a keyboard 210, and an external storage device 212.
- the personal computer main body 202 is typically a general-purpose computer according to a general-purpose architecture, and includes a CPU, a RAM (Random Access Memory), a ROM (Read Only Memory), and the like as basic components.
- the personal computer main body 202 can execute an image processing program 204 for realizing a function provided by the image processing unit 3 shown in FIG.
- Such an image processing program 204 is stored and distributed in a storage medium such as a CD-ROM (Compact Disk-Read Only Memory) or distributed from a server device via a network.
- the image processing program 204 is stored in a storage area such as a hard disk of the personal computer main body 202.
- Such an image processing program 204 implements processing by calling necessary modules among program modules provided as part of an operating system (OS) executed by the personal computer main body 202 at a predetermined timing and order. It may be configured as follows. In this case, the image processing program 204 itself does not include a module provided by the OS, and image processing is realized in cooperation with the OS. Further, the image processing program 204 may be provided by being incorporated in a part of some program instead of a single program. Even in such a case, the image processing program 204 itself does not include a module that is commonly used in the program, and image processing is realized in cooperation with the program. Even such an image processing program 204 that does not include some modules does not depart from the spirit of the image processing apparatus 1 according to the present embodiment.
- OS operating system
- image processing program 204 may be realized by dedicated hardware.
- the monitor 206 displays a GUI screen provided by an operating system (OS), an image generated by the image processing program 204, and the like.
- OS operating system
- the mouse 208 and the keyboard 210 each accept a user operation and output the contents of the accepted user operation to the personal computer main body 202.
- the external storage device 212 stores an input image acquired by some method, and outputs this input image to the personal computer main body 202.
- a device that stores data in a nonvolatile manner such as a flash memory, an optical disk, or a magnetic disk is used.
- FIG. 4 is a schematic diagram showing the relationship between the lens 22a included in the camera 22 that is an array camera and the image sensor 22b that is an image sensor.
- the lens 22a forms an optical image by collecting incident light at a focal point.
- the imaging element 22b is disposed so as to be positioned at the focal point of the lens 22a. Therefore, the lens 22a forms an optical image on the image sensor 22b.
- the image sensor 22 b converts the optical image formed by the lens 22 a into an electrical signal and outputs the electrical signal to the A / D converter 24.
- FIG. 5 is a diagram showing a specific example of the arrangement of the lenses 22 a included in the camera 22.
- the camera 22 is assumed to be an array camera including nine lenses 22a-1 to 22a-9 (lenses A to I) arranged in a grid pattern.
- the intervals (base line lengths) between the lenses A to I in FIG. 5 are uniform in both the vertical direction and the horizontal direction.
- input images A, B, C, D, E, F, G, H, and I from the camera 22 when captured by the camera 22 represent input images from the lenses A to I, respectively. Shall.
- FIG. 6 is a schematic diagram showing an ideal state of a pitch change due to a temperature change of the array lens. That is, as shown in FIG. 6, the array lens ideally has a radial shape centered on the central lens E, that is, the parallax direction of the input image from each lens (the lens arrangement direction) as shown in FIG. ) Is expected to expand and contract evenly.
- FIG. 7 is a diagram showing the measurement result of the positional deviation for each actual lens. 7 uses the 9-lens lens array arranged at 3 ⁇ 3 shown in FIG. 5, and each of the lenses A, C, G, and I arranged at the four corners is 43 ° C. on the basis of the state of 24 ° C. , 64 ° C., and 81 ° C. are shown the measurement results of misalignment. As shown in FIG. 7, it can be seen that the actual lens has a different deformation amount for each lens, and the entire array lens is deformed asymmetrically. Note that how to deform asymmetrically also varies from individual to individual.
- FIG. 8 and 10 are diagrams for comparing the deviation between the reference lens and the surrounding lenses using the lens E (center lens) in the lens array as a reference lens.
- FIG. 8 shows the deviation when there is no temperature change
- FIG. 10 shows the deviation when there is a temperature change.
- FIG. 9 is a diagram for explaining the direction of deviation in the case of FIG. That is, the deviation in the case of FIG. 8 appears in the direction along the arrangement direction of the lens 22a (the direction connecting the central pixel of the lens 22a and the central pixel of the reference lens) as shown in FIG. For example, in the case of the upper left lens A, the shift direction is the upper left direction.
- distortion correction and parallelization processing are performed as stereo calibration.
- the direction in which the parallax appears is assumed to be along the arrangement of the individual eyes. However, in the case of an array in which lenses with small distortion are arranged so that their optical axes are parallel, the correction effect by the distortion correction or parallelization processing is small, and therefore the processing need not be performed.
- FIG. 11 is a diagram for explaining the direction of deviation in the case of FIG.
- the broken-line arrows in FIG. 11 indicate the direction in which the deviation appears due to temperature change
- the solid-line arrows indicate the direction of parallax that appears depending on the distance from the camera 22 to the subject.
- FIG. 11 it can be seen that the direction in which the shift due to the temperature change (broken arrow) is close to the direction of the parallax that appears depending on the distance of the subject (solid arrow), but is slightly different.
- the deviations in these two directions are combined and appear. That is, the direction of deviation in the case of FIG. 10 is slightly different from the epipole line because the deformation is asymmetric.
- the image processing apparatus 1 uses the input image to perform refocus processing as an example of image processing even when there is a temperature change as an example of environmental change with respect to the camera 22. To do.
- FIG. 12 is a flowchart showing an operation flow in the image processing apparatus 1 according to the present embodiment.
- the image processing apparatus 1 nine input images are acquired by executing a process of acquiring an input image with each of the lenses 22 a illustrated in FIG. 5.
- an image having a resolution of about 500 ⁇ 500 pixels is input.
- step S1 a process for estimating the positional deviation in pixel units (integer pixels) is executed.
- step S2 a positional shift due to an environmental change (temperature change or the like) or deformation of a member is estimated.
- step S2 a process for estimating a positional deviation in sub-pixel units (decimal pixels) is executed (step S2).
- the estimation in step S2 improves the accuracy of distance estimation described later, but is not essential.
- the distance from the viewpoint to the subject is calculated in consideration of the positional deviation amount (step S3), and the refocus processing as image processing is executed by adding blur corresponding to the distance using the distance as a parameter.
- the distance calculation in step S3 does not necessarily require calculation of the actual distance, but the relative distance What is necessary is just to calculate by the unit which can recognize distance, ie, the difference in distance.
- the reciprocal of the distance or a numerical value obtained by converting the parallax may be used. In this description, such calculation is referred to as distance calculation.
- An image after the refocus processing is generated as an output image.
- the position deviation estimation process in step S1 is a first stage estimation process in which template matching is performed with a rough pitch in a direction corresponding to a direction formed by the reference image viewpoint and the calculated image viewpoint with respect to the reference image.
- the process (# 1) and the estimation process (# 2) for performing template matching at a finer pitch than the pitch in the first stage are included as the second stage estimation process.
- FIGS. 13 and 14 are diagrams for explaining a first example and a second example of the positional deviation estimation processing in step S1, respectively.
- the image processing apparatus 1 uses one input image as a reference image, and an input image other than the reference image and having a temperature change as a reference image. . Then, the image processing apparatus 1 uses the template (rectangular frame in the figure) in the standard image to the position of the viewpoint (lens) of the standard image and the viewpoint (lens) of the reference image with respect to the corresponding position of the reference image. Coarse estimation (# 1) is performed in which the corresponding position is identified by matching with a coarse pitch (for example, about 4 pixel increments) in the direction of the position. This is because the deformation (deviation) due to temperature change and the direction in which the parallax appears are substantially the same as described above.
- a coarse pitch for example, about 4 pixel increments
- the input image E from the lens E is set as a standard image
- the input image A from the lens A is set as a reference image.
- the image processing apparatus 1 performs ( ⁇ 4, ⁇ 4), (0, 0), (4, 4), (8, 8), (12, 12) with respect to the corresponding position of the reference image.
- template matching is performed with 8 pixels shifted by (24, 24).
- NCC Normalized Cross Correlation
- SAD Sum of Absolute Difference
- SSD Sum of Squared Difference
- the image processing apparatus 1 has a finer pitch around the position identified as the highest in the template in the first stage estimation process (# 1) than in the first stage estimation process (# 1).
- Precise estimation (# 2) is performed in which the corresponding position is specified by matching (for example, in increments of 1 pixel).
- the image processing apparatus 1 surrounds the pixel with the accuracy of one pixel.
- “Rough pitch” is not limited to the direction of shifting pixels for template matching.
- the size of the template may be different between the first stage estimation process (# 1) and the second stage estimation process (# 2). That is, referring to FIG. 14, in the first stage estimation process (# 1), the image processing apparatus 1 performs template matching using a 65 ⁇ 65 pixel size template when the input image is 500 ⁇ 500 pixels. Shall. In this case, preferably, the image processing apparatus 1 reduces the input image from 500 ⁇ 500 pixels to a size of 1 ⁇ 4 horizontal and vertical to 125 ⁇ 125 pixel size, and a 17 ⁇ 17 pixel size template for the input image. Template matching may be performed using Thereby, the template matching process can be speeded up.
- the image processing apparatus 1 extracts 125 pixels by 125 pixels every four pixels, instead of reducing the input image from 500 ⁇ 500 pixels to a size of 1 ⁇ 4 length and width to 125 ⁇ 125 pixels. It may be converted into a low-pixel image having a pixel size, and template matching may be performed on the input image using a template having a size of 17 ⁇ 17 pixels. Thereby, the template matching process can be further accelerated.
- the image processing apparatus 1 performs a planar search (template matching) around the pixel specified in the first stage estimation process (# 1) in the second stage estimation process (# 2). )), It may be searched in a pyramid shape using a reduced image. That is, referring to FIG. 14, as the first step of the second stage estimation process (# 2), the image processing apparatus 1 reduces the input image of 500 ⁇ 500 pixels to a size of 1/4 in the vertical and horizontal directions. The size is set to 125 ⁇ 125 pixels, and template matching is performed for nine locations of ⁇ 1 pixel from the pixels specified using the 17 ⁇ 17 pixel size template for the input image.
- the template matching range corresponds to a range of ⁇ 4 pixels from the specified pixel of the original image before reduction.
- the image processing apparatus 1 reduces the input image of 500 ⁇ 500 pixels to a size of 1/2 in the vertical and horizontal directions to a size of 250 ⁇ 250 pixels. Then, template matching is performed on nine locations of ⁇ 1 pixel from the pixels specified by using a 17 ⁇ 17 pixel size template for the input image. The template matching range corresponds to a range of ⁇ 2 pixels from the specified pixel of the original image before reduction.
- the image processing apparatus 1 is specified using a 17 ⁇ 17 pixel size template without reducing a 500 ⁇ 500 pixel input image. Template matching is performed for nine locations of ⁇ 1 pixel from the selected pixel. Similar to the first stage estimation process (# 1), the image processing apparatus 1 extracts the input image every several pixels and converts it into a low pixel image instead of generating a reduced image, thereby performing template matching. Processing can be further accelerated.
- the image processing apparatus 1 changes the search direction and the search pitch in the positional deviation estimation process in step S1 to change the first stage estimation process (rough estimation (# 1)) and the second stage estimation process (fine estimation).
- step S1 changes the first stage estimation process (rough estimation (# 1)) and the second stage estimation process (fine estimation).
- (# 2)) it is possible to reduce the number of times of template matching (the number of searches) without reducing the estimation accuracy. Therefore, it is possible to estimate the position shift (search for a corresponding pixel) at high speed at the pixel level.
- the process of estimating the position shift in sub-pixel units (decimal pixels) in step S2 is a pixel group including pixels in the vicinity of the pixels estimated as corresponding points in the position shift estimation process in step S1 (for example, surrounding 8 pixels). 9 pixels) including processing for calculating the degree of matching (for example, NCC value) of each template matching.
- FIG. 15 shows a specific example of the NCC values of the pixels estimated as corresponding points and the surrounding eight pixels.
- step S2 quadratic surface fitting is performed based on the degree of coincidence, and the positional deviation in units of subpixels is estimated.
- the positional deviation estimation in sub-pixel units (decimal pixels) in step S2 as an example, the paper “Robust super-resolution processing based on pixel selection considering positional deviation amount” shown in FIG. 16 (electronic information communication)
- the method described in the academic journal, Vol. J92-D, No. 5, pp. 650-660, 2009, May 2009) can be employed. That is, as shown in FIG. 15 and FIG. 16, the coordinates of the pixel having the highest matching degree among the matching degrees for each pixel are specified as the shift amount.
- step S2 instead of the quadric surface fitting described above, other methods such as quadric surface fitting using the X coordinate and the Y coordinate may be employed.
- FIG. 17 is a diagram illustrating the shift amount of the corresponding pixel with respect to the reference image (input image E) for each input image as a pixel value (color density).
- the shift amounts in the X and Y directions are different. It is represented by As an example, the image processing apparatus 1 adds the shift amount of each input image shown in FIG. 17 in the distance calculation processing in step S3.
- FIG. 18A is a diagram showing the addition result of the shift amount of each input image represented by the pixel value in each diagram of FIG. As shown in FIG. 17, since the amount of shift differs for each input image, the overall offset amount differs. However, an image obtained by adding pixel values representing the shift of each input image as it is is shown in FIG. Become.
- the X direction and the Y direction are respectively added for the input image in which a shift in the oblique direction occurs according to the position of the viewpoint (lens) as in the relationship of the input image A with respect to the input image E that is the reference image. Instead, an oblique shift according to the viewpoint (lens) direction may be calculated and added.
- FIG. 18A shows that the shift amount is larger as the pixel value is higher (white color) and the shift amount is lower as the pixel value is lower (dark color).
- FIG. 18B shows an image obtained by adding pixel values representing the shift of each input image when there is no temperature change.
- the refocus processing includes, as preparation processing, processing for correcting a distance image and processing for dividing the distance from the camera 22 to the subject in stages.
- FIG. 19 is a diagram showing the flow of the preparation process in the refocus process in step S4.
- the image processing apparatus 1 generates a distance generated by using one input image (input image E) of the input images as a reference image (FIG. 19A).
- the image (FIG. 19B) is corrected so that the distance from the camera 22 is aligned in several steps for each subject (FIG. 19C).
- a joint bilateral filter is preferably used.
- an averaging filter may be used in which neighboring pixels are used and weighted as the color is closer. Thereby, the distance image of FIG. 19C is generated from the distance image of FIG. 19B.
- the image processing apparatus 1 divides the corrected distance into eight stages as a process of dividing the distance from the camera 22 to the subject. Thereby, the distance image of FIG. 19D is generated from the distance image of FIG. 19C.
- FIG. 20 is a diagram showing the flow of refocus processing.
- the image processing apparatus 1 performs a refocus process, and creates a refocus image with blurring based on FIG.
- FIG. 20 For example, a case will be described in which a refocus image is created by focusing on a lower right subject (stuffed animal) of a captured image.
- the image processing apparatus 1 performs a refocus process to add stronger blur to a subject portion having a different distance from the subject to be focused.
- An example of a method for generating an image with blur is a method for applying a smoothing filter to an input image. Examples of the smoothing filter include a Gaussian filter and an averaging filter.
- the kernel size may be increased such as 5 ⁇ 5 or 7 ⁇ 7.
- the image processing apparatus 1 combines the images in order starting from the blur corresponding to the far distance. As a result, the same blur as when viewed by a person can be expressed on the image, and the display quality can be improved.
- FIG. 21 to 23 are diagrams showing specific examples of refocus images generated by performing the above-described processing in the image processing apparatus 1.
- FIG. 21 is an image in which a subject close to the lower left of the screen is focused from the camera 22
- FIG. 22 is an image in which the subject at the lower right of the screen is focused at a medium distance from the camera 22
- FIG. 23 shows an image in which the object at the upper left of the screen is in focus and is far from the camera 22.
- the image processing apparatus 1 performs super-resolution as an example of image processing using an input image even when there is a temperature change as an example of an environmental change with respect to the camera 22. Execute the process.
- FIG. 24 is a flowchart showing an operation flow in the image processing apparatus 1 according to the present embodiment.
- nine input images are acquired by executing the process of acquiring the input image with each of the lenses 22a shown in FIG.
- an image having a resolution of about 500 ⁇ 500 pixels is input.
- step S1 a process for estimating the positional deviation in pixel units (integer pixels) is executed (step S1 ').
- step S2 a process of estimating a positional deviation in sub-pixel units (decimal pixels) is executed (step S2 ').
- step S5 super-resolution processing as image processing is executed in consideration of the amount of positional deviation (step S5), and a high-resolution image of about 1500 ⁇ 1500 pixels is generated as an output image.
- step S1 ′ and step S2 ′ is the same as the positional deviation estimation processing in step S1 and step S2 in the image processing apparatus 1 according to the first embodiment.
- the image processing apparatus 1 according to the second embodiment performs the same processing by exchanging the base image and the reference image.
- FIG. 25 and FIG. 26 are diagrams for explaining a first example and a second example of the positional deviation estimation processing in step S1 ', respectively.
- the first example and the second example correspond to the first example and the second example of the misregistration estimation process in the first embodiment, which are shown in FIGS. 13 and 14, respectively. is there.
- the image processing apparatus 1 uses one input image as a reference image and an input image other than the reference image.
- the template in the standard image is compared with the position of the viewpoint (lens) of the standard image and the position of the viewpoint (lens) of the reference image with respect to the corresponding position of the reference image.
- Coarse estimation (# 1) is performed in which the corresponding position is specified by matching with a coarse pitch (for example, in units of about 4 pixels) in the formed direction.
- the image processing apparatus 1 uses the standard image and the reference image in reverse as described above.
- the image processing apparatus 1 according to the second embodiment uses the input image E, which is the standard image in the first embodiment, as a reference image, and other input that is the reference image in the first embodiment.
- An image (for example, input image A) is used as a reference image. Then, the image processing apparatus 1 according to the second embodiment performs template matching similar to that in the first embodiment.
- the template size may be made different between the first stage estimation process (# 1) and the second stage estimation process (# 2). Good. That is, in the first stage estimation process (# 1), when the input image is 500 ⁇ 500 pixels, the image processing apparatus 1 performs template matching using a 65 ⁇ 65 pixel size template. Further, as a second example, the image processing apparatus 1 performs a planar search (template matching) around the pixel specified in the first stage estimation process (# 1) in the second stage estimation process (# 2). ), As shown in FIG. 26 (similar to the first embodiment), a reduced image may be used to search in a pyramid shape.
- the image processing apparatus 1 uses the input image E, which is the standard image in the first embodiment, as a reference image, and the reference image in the first embodiment.
- the other input image (for example, input image A) is used as the reference image.
- FIG. 27 is a diagram showing the flow of super-resolution processing in step S5.
- the paper “Fast and Robust Multiframe Super Resolution” (IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 13, NO. 10, OCTOBER 2004 page. 1327-1344) is described. The flow of resolution processing is shown.
- step # 31 one of the nine input images is subjected to an interpolation process such as a bilinear method, and the resolution of the input image is the resolution after the super-resolution process. As a result, an output candidate image as an initial image is generated.
- an interpolation process such as a bilinear method
- step # 32 a BTV (Bilateral Total Variation) amount as a constraint term for robust convergence to noise is calculated.
- step # 33 the generated output candidate images are compared with the nine input images, and a residual is calculated.
- step # 34 the residual and the BTV amount calculated from the output candidate image generated in step # 31 are reduced, and the next output candidate image is generated.
- steps # 31 to # 34 are repeated until the output candidate image converges, and the converged output candidate image is output as an output image after the super-resolution processing.
- the number of iterations may be a predetermined number of times such as the number of times of convergence (for example, 200 times), or a convergence determination may be made for each series of processing, and may be repeated according to the result. .
- FIG. 28 is a diagram for explaining the deterioration information used in step # 33.
- FIGS. 29 to 33 are diagrams for explaining the processing in step # 33.
- Deterioration information refers to information representing the relationship of each input image with respect to a high-resolution image after super-resolution processing, and is represented, for example, in a matrix format.
- Degradation information includes a shift amount F (for the remaining small number of translated pixels) of each input image, a downsampling amount D (1/3 in each of the vertical and horizontal directions in the above example), and a blur amount H (PSF). ) Etc. are included.
- the deterioration information is defined by a matrix indicating the conversion when each of the input image and the high-resolution image after super-resolution processing is expressed as a one-dimensional vector.
- step # 33 first, referring to FIG. 29, an input size image DkHkFkXn is generated by applying deterioration information DkHkFk for the input image Yk to the output candidate image Xn generated from the input image Yk.
- Step # 41 Specifically, referring to FIG. 30, first, the output candidate image Xn is subjected to filter processing using a matrix having a coefficient of PSF, which is a parameter representing the blur amount Hk, for the processing here (see FIG. 30). Step S11).
- step S12 down-sampling is performed in consideration of the deviation (step S12).
- an input size image DkHkFkXn is output.
- the shift amount F is a shift of 1/3 pixel in the X direction and the downsampling amount D is 1/3 vertical and horizontal, it is filtered.
- One pixel at which the average value of the pixels in the rectangular area of nine pixels at the position shifted by 1/3 pixel of the subsequent output candidate image Xn is shifted by 1/3 pixel of the input image DkHkFkXn Is output as a minute pixel value (step S13).
- the output candidate image DkHkFkXn which is an input size image
- an image sign (DkHkFkXn-Yk) of the difference is recorded (step # 42).
- an example in which the sign function sign is applied to the difference between the output candidate image DkHkFkXn and the input image Yk is shown.
- step # 43 processing for returning the image sign (DkHkFkXn ⁇ Yk) of the difference to the image size after super-resolution is performed (step # 43).
- the transposed matrix is used in step # 43. That is, referring to FIG.
- step S14 when the difference image sign (DkHkFkXn-Yk) is generated as described above (step S14), the processing here is up-sampled in consideration of the deviation (step S14). Step S15).
- the shift amount F is a shift of 1/3 pixel in the X direction and the downsampling amount D is 1/3 vertical and horizontal, the difference image sign.
- a filter transpose matrix using PSF as a coefficient representing the blur amount Hk as a coefficient is applied to return the effect of the blur amount Hk (step S16), and the processed image is super-resolution.
- the difference image Dk T Hk T Fk T sign (DkHkFkXn ⁇ Yk) returned to the later image size is output (step S17).
- FIG. 34 is a flowchart showing an example of the residual calculation process in step # 33. Since there are nine input images in this example, the processes of steps S11 to S17 are repeated for the number of sheets as shown in FIG. 34 in the residual calculation process of step # 33. That is, with reference to FIG. 34, the above-described processing is performed as steps S11 to S17 for the first input image Y1, and an image having a difference in image size after super-resolution is output. The above processing is performed for Y2 as Steps S21 to S27, and an image having a difference in image size after super-resolution is output... The image of the difference in image size after super-resolution is output.
- the total value is output as a residual (step S100).
- the processing order of the deviation amount F and the blur amount H is opposite to that described in the paper. However, since blur occurs in a certain large range of the image, the order is substantially changed even if the order is changed. There is no impact.
- I ′ (x + i, y + j) ⁇ PSF (i, j) I (x, y) It is expressed as That is, the output pixel value I ′ is a total value obtained by processing all the pixels of the input pixel value I.
- FIG. 35 is a diagram showing another example of the super-resolution processing in step S5. That is, referring to FIG. 35, the constraint term calculated in step # 32 may be replaced with the BTV amount, for example, another one such as 4-neighbor Laplacian (step # 32 ').
- the residual calculation process in step # 33 may be a different calculation method.
- the difference between the output candidate image DkHkFkXn and the input image Yk may be directly used without using the sign function sign.
- the image processing apparatus 1 uses an input image as an example of image processing even when there is a temperature change as an example of an environmental change with respect to the camera 22. Perform resolution processing and refocus processing.
- FIG. 36 is a flowchart showing an operation flow in the image processing apparatus 1 according to the present embodiment.
- the image processing apparatus 1 according to the third embodiment performs a refocus process that is an image process according to the first embodiment and a super-resolution process that is an image process according to the second embodiment. By performing this operation on the input image, a refocus image and a super-resolution image are obtained and combined. That is, with reference to FIG. 36, steps S1 to S4 (FIG. 12) in the image processing apparatus 1 according to the first embodiment and steps in the image processing apparatus 1 according to the second embodiment.
- the processing of S1 ′ and S2 ′ (FIG. 24) is performed on the input image to obtain a refocus image and a super-resolution image.
- the image processing apparatus 1 performs resolution conversion such as bilinear interpolation on the refocused image obtained by the processing in steps S1 to S4 (step S6), and then combines it with the super-resolution image (step S7). ).
- FIG. 37 is a diagram for explaining the composition processing in step S7.
- image processing apparatus 1 performs resolution conversion in step S6 of the refocus image for pixels (regions) to which blur is added during the refocus processing in step S4 of the refocus image. Used pixels.
- the pixels obtained by the super-resolution processing in step S5 in the refocus image are averaged using, for example, a 3 ⁇ 3 averaging filter.
- a 3 ⁇ 3 averaging filter during the refocusing process has substantially the same resolution as averaging a super-resolution image using a 9 ⁇ 9 averaging filter. Therefore, by averaging in this way, it is possible to smoothly change between the blurred area and the super-resolution area.
- the focus image may be used after resolution conversion.
- the image processing apparatus 1 according to the fourth embodiment is configured to perform image processing using an input image from the camera 22 even when there is a temperature change as an example of an environmental change with respect to the camera 22. Calculate the distance to the subject accurately.
- FIG. 39 is a flowchart showing an operation flow in the image processing apparatus 1 according to the present embodiment.
- the image processing apparatus 1 according to the fourth embodiment estimates the positional deviation in the same manner as the image processing apparatus 1 according to the first to third embodiments (step S1). Then, the misalignment amount is corrected (step S8).
- FIG. 40 to 42 are diagrams for explaining a method of correcting the positional deviation amount in step S8.
- the distance image representing the shift amount of the corresponding pixel with respect to the reference image (input image E) for each input image shown in FIG. 40 indicates that the shift amount is entirely different for each image. Therefore, as shown in FIG. 41, the image processing apparatus 1 calculates the average value of the shift amounts for each image, and specifies the minimum value from the 12 average values. Then, the difference from the minimum value for each image is set as the correction amount. The image processing apparatus 1 subtracts the correction amount from the shift amount for each image.
- FIG. 42 shows the result of correcting each figure of FIG. By performing this correction, the average values of the images are aligned.
- the image processing apparatus 1 extracts erroneous data (noise) from the corrected image in step S8 (step S9).
- 43 to 45 are diagrams for explaining a method of extracting error data in step S9.
- the image processing apparatus 1 creates a histogram for the corresponding pixel positions of the 12 images after correction. Then, the image processing apparatus 1 determines that the pixel value (deviation amount) deviating from the histogram is an error. For each figure, the image processing apparatus 1 determines the entire image, for example, by creating a histogram at a pitch of 3 pixels.
- FIG. 44 shows a histogram created for each corresponding pixel position with respect to the circle at the upper right of each of the 12 images in FIG.
- the image processing apparatus 1 specifies a location where the histogram value is the maximum of two consecutive pixel values in the histogram of FIG. 44, and determines pixel values other than that location as erroneous data.
- the place where the histogram value is the maximum is specified as the place A having the pixel values 0 to 6, and the pixel having the pixel value indicated in this place A is correct (the pixel having an appropriate pixel value). It is determined.
- the histogram value at the location B near the pixel value 30 is determined to be erroneous data.
- a white area in the figure represents an area having a pixel value determined to be erroneous data.
- step S9 when the image processing apparatus 1 determines the error data (noise) for each input image by the method described above in step S9, the image processing apparatus 1 adds using the pixels excluding the pixels that are erroneous data in each figure. By performing the process, the distance is estimated (step S10).
- FIG. 46 shows a distance image obtained by adding the respective figures excluding the pixels shown in white in FIG.
- step S10 pixels that are determined to be correct for all input images are added as they are. However, for example, as shown in the histogram of FIG. 44, only 10 of 12 images are determined to be correct. 10 pixels are added and then multiplied by 12/10 to match the pixel weight.
- the image processing apparatus 1 uses an input image from the camera 22 that is an array camera in which lenses are arranged as shown in FIG. 5, but the lens is not limited to that shown in FIG. 47 and 48 are diagrams showing other examples of lenses included in the camera 22.
- FIG. That is, in the above description, it is assumed that the array lenses A to P are held at the four corners. However, as shown in FIG. 47, the array lenses A to P may be held only at one of the four corners (for example, upper left). In this case, as shown in FIG. 47, the deformation of each lens is asymmetrical, and is deformed substantially radially around the held corner.
- the positional deviation of each lens with respect to the lens A closest to the held corner is the direction of parallax of the input image from each lens around the lens A (the lens It expands and contracts in the direction of placement. Therefore, even in such a case, the image processing apparatus 1 can search for corresponding points by performing the positional deviation estimation process similar to that in step S1.
- the image processing apparatus 1 can search for corresponding points by performing the positional deviation estimation process similar to that in step S1.
- the lens 22a included in the camera 22 which is an array camera is affected by an environmental change such as a temperature change
- the lens 22a may expand and contract as a whole and the lens interval (pitch) may fluctuate.
- the lens 22a and its holding member are materials that are easily affected by the environment, such as plastic, the variation easily appears.
- the variation does not necessarily occur equally. Therefore, the corresponding points necessary for image processing such as distance calculation processing, super-resolution processing, and refocus processing may shift asymmetrically.
- the image processing apparatus 1 uses the feature that in the corresponding point search, the arrangement direction of each lens (the direction in which the parallax appears) and the direction of the pitch fluctuation due to the temperature change are approximately the same direction. , Search in the direction with coarse accuracy (pitch) as the first step, and search in a planar manner without limiting the direction with finer accuracy (pitch) than the first step around the searched pixels when matching as the second step . This makes it possible to search for corresponding points at high speed and with high accuracy.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- Radar, Positioning & Navigation (AREA)
- Health & Medical Sciences (AREA)
- Electromagnetism (AREA)
- Computing Systems (AREA)
- Databases & Information Systems (AREA)
- Remote Sensing (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Image Processing (AREA)
- Measurement Of Optical Distance (AREA)
- Studio Devices (AREA)
Abstract
Description
この発明は画像処理装置および画像処理方法に関し、特に、対応点探索を行なう画像処理装置および画像処理方法に関する。 The present invention relates to an image processing apparatus and an image processing method, and more particularly to an image processing apparatus and an image processing method for searching for corresponding points.
それぞれが共通する部分領域を有する多視点の入力画像間の対応点を探索し、各視点から対象物までの距離を算出し、その距離に応じて視差量を補正する画像処理の手法がある。たとえば、特開2000-28355号公報(以下、特許文献1)は、エピポーラ線のずれを検出することで、視差推定ミスを減らす技術を開示している。また、特開平9-153148号公報(以下、特許文献2)は、移動、回転、倍率変換などを行なって、最もエピポーラ線の平行化された条件を探す技術を開示している。また、特開2012-107971号公報(以下、特許文献3)は、対応点の探索を、粗い検索と、近くの被写体についての細かい探索との2段階で行なう技術を開示している。 There is an image processing method in which corresponding points between multi-viewpoint input images each having a common partial area are searched, a distance from each viewpoint to an object is calculated, and a parallax amount is corrected according to the distance. For example, Japanese Patent Laid-Open No. 2000-28355 (hereinafter referred to as Patent Document 1) discloses a technique for reducing a parallax estimation error by detecting a deviation of an epipolar line. Japanese Patent Laid-Open No. 9-153148 (hereinafter referred to as Patent Document 2) discloses a technique for searching for the most parallelized condition of epipolar lines by performing movement, rotation, magnification conversion, and the like. Japanese Patent Laying-Open No. 2012-107971 (hereinafter referred to as Patent Document 3) discloses a technique for searching for corresponding points in two stages: a coarse search and a fine search for nearby subjects.
上記特許文献1~3は対応点探索の精度を向上させるものではあるが、高速化のニーズには対応することができない。
Although the
本発明はこのような問題に鑑みてなされたものであって、高速かつ高精度で対応点を探索することのできる画像処理装置および画像処理方法を提供することを目的としている。 The present invention has been made in view of such problems, and an object thereof is to provide an image processing apparatus and an image processing method capable of searching for corresponding points at high speed and with high accuracy.
上記目的を達成するために、本発明のある局面に従うと、画像処理装置は、それぞれが共通する部分領域を有する多視点の入力画像群のうちの1つの入力画像を基準画像とし、基準画像上の1画素の、基準画像以外の入力画像での対応する画素を推定する画像処理装置であって、基準画像以外の入力画像の1画素に対応する位置から、基準画像の視点と基準画像以外の入力画像の視点とのなす方向に対応した方向で第1のピッチでテンプレートマッチングを行なうことで、上記1画素に対応する画素を推定するための第1の推定部と、第1の推定部で推定された画素に対して、第1のピッチよりも細かい第2のピッチでテンプレートマッチングを行なうことで、上記1画素に対応する画素を推定するための第2の推定部とを備える。 In order to achieve the above object, according to an aspect of the present invention, an image processing apparatus uses, as a reference image, one input image in a group of multi-viewpoint input images each having a common partial area, An image processing apparatus for estimating a corresponding pixel in an input image other than the reference image, from a position corresponding to one pixel of the input image other than the reference image, By performing template matching at a first pitch in a direction corresponding to the direction formed by the viewpoint of the input image, a first estimation unit for estimating a pixel corresponding to the one pixel, and a first estimation unit A second estimation unit configured to estimate a pixel corresponding to the one pixel by performing template matching on the estimated pixel at a second pitch smaller than the first pitch.
好ましくは、第2の推定部は、第1の推定部で用いるテンプレートのサイズ以下のサイズのテンプレートを用いてテンプレートマッチングを行なう。 Preferably, the second estimation unit performs template matching using a template having a size equal to or smaller than the size of the template used in the first estimation unit.
好ましくは、画像処理装置は、上記1画素と第2の推定部で推定された上記1画素に対応する画素との間のずれに基づいて、小数画素でのずれ量を推定するための第3の推定部をさらに備える。 Preferably, the image processing apparatus is configured to estimate a shift amount in a decimal pixel based on a shift between the one pixel and a pixel corresponding to the one pixel estimated by the second estimation unit. The estimation part is further provided.
好ましくは、上記1画素と基準画像以外の入力画像の上記1画素に対応する画素との間のずれに基づいて、基準画像の視点から被写体までの距離を算出する処理を実行するための処理部をさらに備える。 Preferably, a processing unit for executing processing for calculating a distance from the viewpoint of the reference image to the subject based on a shift between the one pixel and a pixel corresponding to the one pixel of the input image other than the reference image Is further provided.
より好ましくは、処理部は、基準画像以外の複数の入力画像それぞれのずれを加算することで、基準画像の視点から被写体までの距離を算出する。 More preferably, the processing unit calculates the distance from the viewpoint of the reference image to the subject by adding the deviations of each of the plurality of input images other than the reference image.
より好ましくは、処理部は、基準画像以外の複数の入力画像それぞれのずれから補正量を算出し、それぞれのずれを補正する。 More preferably, the processing unit calculates a correction amount from a shift of each of the plurality of input images other than the reference image, and corrects each shift.
好ましくは、画像処理装置は、基準画像以外の入力画像について、上記1画素と基準画像以外の入力画像の上記1画素に対応する画素との間のずれをパラメーターとして用いて超解像処理を実行するための処理部をさらに備える。 Preferably, the image processing apparatus performs super-resolution processing on an input image other than the reference image using a shift between the one pixel and a pixel corresponding to the one pixel of the input image other than the reference image as a parameter. A processing unit is further provided.
好ましくは、画像処理装置は、入力画像のそれぞれに対して、前処理として歪曲補正と平行化処理とを行なうための前処理部をさらに備える。 Preferably, the image processing apparatus further includes a preprocessing unit for performing distortion correction and parallelization processing as preprocessing for each of the input images.
本発明の他の局面に従うと、画像処理方法は、それぞれが共通する部分領域を有する多視点の入力画像群のうちの1つの入力画像を基準画像とし、基準画像上の1画素の、基準画像以外の入力画像での対応する画素を推定する方法であって、基準画像以外の入力画像の上記1画素に対応する位置から、基準画像の視点と基準画像以外の入力画像の視点とのなす方向に対応した方向で第1のピッチでテンプレートマッチングを行なうことで、上記1画素に対応する画素を推定するステップと、推定された画素に対して、第1のピッチよりも細かい第2のピッチでテンプレートマッチングを行なうことで、上記1画素に対応する画素を推定するステップとを備える。 According to another aspect of the present invention, an image processing method uses, as a reference image, one reference image of a multi-viewpoint input image group having a common partial area, and a reference image of one pixel on the reference image. A method of estimating a corresponding pixel in an input image other than the reference image, and a direction formed by the viewpoint of the reference image and the viewpoint of the input image other than the reference image from the position corresponding to the one pixel of the input image other than the reference image By performing template matching at a first pitch in a direction corresponding to the above, and estimating a pixel corresponding to the one pixel, and a second pitch smaller than the first pitch with respect to the estimated pixel. Estimating a pixel corresponding to the one pixel by performing template matching.
本発明のさらに他の局面に従うと、画像処理プログラムは、コンピューターに、それぞれが共通する部分領域を有する多視点の入力画像群のうちの1つの入力画像を基準画像とし、基準画像上の1画素の、基準画像以外の入力画像での対応する画素を推定する処理を実行させるプログラムであって、基準画像以外の入力画像の上記1画素に対応する位置から、基準画像の視点と基準画像以外の入力画像の視点とのなす方向に対応した方向で第1のピッチでテンプレートマッチングを行なうことで、上記1画素に対応する画素を推定するステップと、推定された画素に対して、第1のピッチよりも細かい第2のピッチでテンプレートマッチングを行なうことで、上記1画素に対応する画素を推定するステップとをコンピューターに実行させる。 According to still another aspect of the present invention, an image processing program causes a computer to use one input image of a multi-viewpoint input image group having a common partial area as a reference image, and one pixel on the reference image. A program for executing a process for estimating a corresponding pixel in an input image other than the reference image, from a position corresponding to the one pixel in the input image other than the reference image, Performing a template matching at a first pitch in a direction corresponding to a direction formed with the viewpoint of the input image to estimate a pixel corresponding to the one pixel, and a first pitch with respect to the estimated pixel By performing template matching at a finer second pitch, the computer is caused to execute the step of estimating the pixel corresponding to the one pixel.
この発明によると、高速かつ高精度で対応点を探索することができる。 According to the present invention, it is possible to search for corresponding points at high speed and with high accuracy.
以下に、図面を参照しつつ、本発明の実施の形態について説明する。以下の説明では、同一の部品および構成要素には同一の符号を付してある。それらの名称および機能も同じである。したがって、これらの説明は繰り返さない。 Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the following description, the same parts and components are denoted by the same reference numerals. Their names and functions are also the same. Therefore, these descriptions will not be repeated.
<システム構成>
図1は、本実施の形態にかかる画像処理装置1の構成の基本的構成を示すブロック図である。
<System configuration>
FIG. 1 is a block diagram showing a basic configuration of an
図1を参照して、画像処理装置1は、撮像部2と、画像処理部3と、画像出力部4とを含む。図1に示す画像処理装置1においては、撮像部2が被写体を撮像することで画像(以下、「入力画像」とも称する)を取得し、画像処理部3がこの取得された入力画像に対して後述するような画像処理を行なう。そして、画像出力部4は、画像処理後の画像を表示デバイスなどへ出力する。
Referring to FIG. 1, the
撮像部2は、対象物(被写体)を撮像して入力画像を生成する。より具体的には、撮像部2は、カメラ22と、カメラ22と接続されたA/D(Analog to Digital)変換部24とを含む。A/D変換部24は、カメラ22により撮像された被写体を示す入力画像を出力する。
The
カメラ22は、被写体を撮像するための光学系であって、アレイカメラである。すなわち、カメラ22は、格子状に配置された視点の異なるN個のレンズ22a-1~22a-n(これらを代表させて、レンズ22aとも称する)と、撮像素子(イメージセンサー)22bとを含む。
The
A/D変換部24は、撮像素子22bから出力される被写体を示す映像信号(アナログ電気信号)をデジタル信号に変換して出力する。撮像部2はさらに、カメラ各部分を制御するための制御処理回路などを含み得る。
The A /
画像処理部3は、位置ずれ推定処理を行なうことで対応点を探索するための位置ずれ推定部32と、後述する画像処理を行なうための処理部33とを含む。好ましくは、画像処理部3は、入力された画像に対して前処理として歪曲補正および平行化処理を実行するための前処理部31を含む。
The
位置ずれ推定部32は、ピクセル(整数画素)単位でのずれ量を推定する処理のうちの第1段階の「粗い」推定処理を行なうための第1推定部321と、ピクセル単位でのずれ量を推定する処理のうちの第2段階の推定処理を行なうための第2推定部322とを含む。好ましくは、位置ずれ推定部32は、さらに、サブピクセル(小数画素)単位でのずれ量を推定する処理を行なうための第3推定部323を含む。
The
図1に示す画像処理装置1は、各部を独立の装置で具現化したシステムとして構成することもできるが、汎用的には、以下に説明するデジタルカメラやパーソナルコンピューターなどとして具現化される場合が多い。そこで、本実施の形態に従う画像処理装置1の具現化例として、デジタルカメラでの具現化例とPC(パーソナルコンピューター)での具現化例とについて説明する。
The
図2は、図1に示す画像処理装置1を具現化したデジタルカメラ100の構成を示すブロック図である。図2において、図1に示す画像処理装置1を構成するそれぞれのブロックに対応するコンポーネントには、図1と同一の参照符号を付している。
FIG. 2 is a block diagram showing a configuration of a
図2を参照して、デジタルカメラ100は、CPU(Central Processing Unit)102と、デジタル処理回路104と、画像表示部108と、カードインターフェイス(I/F)110と、記憶部112と、カメラ部114とを含む。
Referring to FIG. 2, a
CPU102は、予め格納されたプログラムなどを実行することで、デジタルカメラ100の全体を制御する。デジタル処理回路104は、本実施の形態に従う画像処理を含む各種のデジタル処理を実行する。デジタル処理回路104は、典型的には、DSP(Digital Signal Processor)、ASIC(Application Specific Integrated Circuit)、LSI(Large Scale Integration)、FPGA(Field-Programmable Gate Array)などによって構成される。このデジタル処理回路104は、図1に示す画像処理部3が提供する機能を実現するための画像処理回路106を含む。
The
画像表示部108は、カメラ部114により提供される入力画像、デジタル処理回路104(画像処理回路106)によって生成される出力画像、デジタルカメラ100に係る各種設定情報、および、制御用GUI(Graphical User Interface)画面などを表示する。
The
カードインターフェイス(I/F)110は、画像処理回路106によって生成された画像データを記憶部112へ書き込み、あるいは、記憶部112から画像データなどを読み出すためのインターフェイスである。記憶部112は、画像処理回路106によって生成された画像データや各種情報(デジタルカメラ100の制御パラメーターや動作モードなどの設定値)を格納する記憶デバイスである。この記憶部112は、フラッシュメモリ、光学ディスク、磁気ディスクなどからなり、データを不揮発的に記憶する。
The card interface (I / F) 110 is an interface for writing image data generated by the
カメラ部114は、被写体を撮像することで入力画像を生成する。
図2に示すデジタルカメラ100は、本実施の形態に従う画像処理装置1の全体を単体の装置として実装したものである。すなわち、ユーザーは、デジタルカメラ100を用いて被写体を撮像することで、画像表示部108において高解像度の画像を視認することができる。
The
A
図3は、図1に示す画像処理装置1を具現化したパーソナルコンピューター200の構成を示すブロック図である。図3に示すパーソナルコンピューター200は、本実施の形態に従う画像処理装置1の一部を単体の装置として実装したものである。図3に示すパーソナルコンピューター200では、入力画像を取得するための撮像部2が搭載されておらず、任意の撮像部2によって取得された入力画像が外部から入力される構成となっている。このような構成であっても、本発明の実施の形態に従う画像処理装置1に含まれ得る。なお、図3においても、図1に示す画像処理装置1を構成するそれぞれのブロックに対応するコンポーネントには、図1と同一の参照符号を付している。
FIG. 3 is a block diagram showing a configuration of a
図3を参照して、パーソナルコンピューター200は、パーソナルコンピューター本体202と、モニター206と、マウス208と、キーボード210と、外部記憶装置212とを含む。
3, the
パーソナルコンピューター本体202は、典型的には、汎用的なアーキテクチャーに従う汎用コンピューターであり、基本的な構成要素として、CPU、RAM(Random Access Memory)、ROM(Read Only Memory)などを含む。パーソナルコンピューター本体202は、図1に示す画像処理部3が提供する機能を実現するための画像処理プログラム204が実行可能になっている。このような画像処理プログラム204は、CD-ROM(Compact Disk-Read Only Memory)などの記憶媒体に格納されて流通し、あるいは、ネットワークを介してサーバー装置から配信される。そして、画像処理プログラム204は、パーソナルコンピューター本体202のハードディスクなどの記憶領域内に格納される。
The personal computer
このような画像処理プログラム204は、パーソナルコンピューター本体202で実行されるオペレーティングシステム(OS)の一部として提供されるプログラムモジュールのうち必要なモジュールを、所定のタイミングおよび順序で呼出して処理を実現するように構成されてもよい。この場合、画像処理プログラム204自体には、OSが提供するモジュールは含まれず、OSと協働して画像処理が実現される。また、画像処理プログラム204は、単体のプログラムではなく、何らかのプログラムの一部に組込まれて提供されてもよい。このような場合にも、画像処理プログラム204自体には、当該何らかのプログラムにおいて共通に利用されるようなモジュールは含まれず、当該何らかのプログラムと協働して画像処理が実現される。このような一部のモジュールを含まない画像処理プログラム204であっても、本実施の形態に従う画像処理装置1の趣旨を逸脱するものではない。
Such an
もちろん、画像処理プログラム204によって提供される機能の一部または全部を専用のハードウェアによって実現してもよい。
Of course, some or all of the functions provided by the
モニター206は、オペレーティングシステム(OS)が提供するGUI画面、画像処理プログラム204によって生成される画像などを表示する。
The
マウス208およびキーボード210は、それぞれユーザー操作を受付け、その受付けたユーザー操作の内容をパーソナルコンピューター本体202へ出力する。
The
外部記憶装置212は、何らかの方法で取得された入力画像を格納しており、この入力画像をパーソナルコンピューター本体202へ出力する。外部記憶装置212としては、フラッシュメモリ、光学ディスク、磁気ディスクなどのデータを不揮発的に記憶するデバイスが用いられる。
The
図4は、アレイカメラであるカメラ22に含まれるレンズ22aと撮像センサーである撮像素子22bとの関係を表わした概略図である。図4を参照して、レンズ22aは、入光を焦点に集めることで光学像を形成する。撮像素子22bはレンズ22aの焦点に位置するように配置される。そのため、レンズ22aは撮像素子22bに光学像を形成する。撮像素子22bは、レンズ22aにより形成された光学像を電気信号に変換して、A/D変換部24に対して出力する。
FIG. 4 is a schematic diagram showing the relationship between the
図5は、カメラ22に含まれるレンズ22aの配置の具体例を表わした図である。図5の例では、一例として、カメラ22が、格子状に配置された9個のレンズ22a-1~22a-9(レンズA~I)を含むアレイカメラであるものとする。図5のレンズA~Iの間隔(基線長)は、縦方向および横方向ともに均一であるものとする。なお、カメラ22で撮影したときの、カメラ22からの入力画像A,B,C,D,E,F,G,H,Iは、それぞれ、レンズA~Iからの入力画像であることを表わすものとする。
FIG. 5 is a diagram showing a specific example of the arrangement of the
[第1の実施の形態]
<動作概要>
(レンズへの環境変化の影響の説明)
図6~図11は、レンズ22aがプラスチックアレイレンズであるときの環境条件の変化の一例としての温度変化の影響を説明するための図である。プラスチックアレイレンズであるレンズ22aの温度変化による影響の1つに、レンズ22a間のピッチ(間隔)が変化し、画素位置がずれることが挙げられる。
[First Embodiment]
<Overview of operation>
(Explanation of environmental impact on lens)
6 to 11 are diagrams for explaining the influence of a temperature change as an example of a change in environmental conditions when the
図6は、アレイレンズの温度変化によるピッチ変化の理想的な状態を表わした概略図である。すなわち、図6に示されたように、温度変化によってアレイレンズは、理想的には、中央のレンズEを中心として放射状に、つまり、各レンズからの入力画像の視差の方向(レンズの配置方向)に、均等に伸び縮みすることが予想される。 FIG. 6 is a schematic diagram showing an ideal state of a pitch change due to a temperature change of the array lens. That is, as shown in FIG. 6, the array lens ideally has a radial shape centered on the central lens E, that is, the parallax direction of the input image from each lens (the lens arrangement direction) as shown in FIG. ) Is expected to expand and contract evenly.
これに対して、図7は、実際のレンズごとの位置ずれの測定結果を表わした図である。図7は、図5に示した3×3で配置された9眼のレンズアレイを用い、四隅に配置されたレンズA,C,G,Iそれぞれについて、24℃の状態を基準として、43℃、64℃、および81℃に変化させたときの位置ずれの測定結果を示している。図7に示されたように実際のレンズは、レンズごとに変形量が異なり、アレイレンズ全体として非対称に変形することが分かる。なお、どのように非対称に変形するかについても個体ごとに異なる。 On the other hand, FIG. 7 is a diagram showing the measurement result of the positional deviation for each actual lens. 7 uses the 9-lens lens array arranged at 3 × 3 shown in FIG. 5, and each of the lenses A, C, G, and I arranged at the four corners is 43 ° C. on the basis of the state of 24 ° C. , 64 ° C., and 81 ° C. are shown the measurement results of misalignment. As shown in FIG. 7, it can be seen that the actual lens has a different deformation amount for each lens, and the entire array lens is deformed asymmetrically. Note that how to deform asymmetrically also varies from individual to individual.
図8および図10は、レンズアレイのうちのレンズE(中央のレンズ)を基準レンズとして、基準レンズと周囲のレンズとのずれを比較するための図である。図8は温度変化がない場合のずれを表わし、図10は温度変化がある場合のずれを表わしている。 8 and 10 are diagrams for comparing the deviation between the reference lens and the surrounding lenses using the lens E (center lens) in the lens array as a reference lens. FIG. 8 shows the deviation when there is no temperature change, and FIG. 10 shows the deviation when there is a temperature change.
図8を参照して、温度変化がない場合には、無限遠ではずれがなく、近くの被写体ほどずれが大きく現れる。図9は、図8の場合のずれの方向を説明するための図である。すなわち、図8の場合のずれは、図9に表わされたようにレンズ22aの配置方向に沿った方向(レンズ22aの中央画素と基準レンズの中央画素とを結んだ方向)に現れる。たとえば、左上のレンズAの場合には、ずれ方向は左上方向となる。なお、図8は、ステレオキャリブレーションとして歪曲補正および平行化処理を行なっている。また、視差の現れる方向(エピポールライン)は、個眼の配置に沿うものとしている。ただし、歪曲収差が小さいレンズを光軸が平行になるように配置したアレイの場合、歪曲補正や平行化処理による補正効果が小さいため、処理を行なわなくてもよい。
Referring to FIG. 8, when there is no temperature change, there is no deviation at infinity, and the deviation becomes larger as the subject is closer. FIG. 9 is a diagram for explaining the direction of deviation in the case of FIG. That is, the deviation in the case of FIG. 8 appears in the direction along the arrangement direction of the
これに対して、温度変化がある場合には、図10に示されたように、変形の影響がレンズ22aごとに不均等に現れる。すなわち、レンズ22aごとにずれる方向もずれ量も異なってくる。図11は、図10の場合のずれの方向を説明するための図である。図11の破線の矢印は温度変化によってずれの現れる方向を表わし、実線の矢印はカメラ22から被写体までの距離により現れる視差の方向を表わしている。図11を参照して、温度変化によるずれの現れる方向(破線矢印)は、被写体の距離により現れる視差の方向(実線矢印)に近いが、多少異なっていることがわかる。各画像には、この2つの方向のずれが合成されて、現れることになる。すなわち、図10の場合のずれの方向は、変形が非対称であるためにエピポールラインとは多少異なる方向となる。
On the other hand, when there is a temperature change, as shown in FIG. 10, the influence of deformation appears unevenly for each
(動作概要)
第1の実施の形態にかかる画像処理装置1は、カメラ22に対して環境変化の一例としての温度変化があった場合であっても、入力画像を用いて画像処理の一例としてのリフォーカス処理を行なう。
(Overview of operation)
The
<動作フロー>
(全体動作)
図12は、本実施の形態にかかる画像処理装置1での動作の流れを表わすフローチャートである。図12を参照して、まず、画像処理装置1では図5に表わされたレンズ22aそれぞれで入力画像を取得する処理が実行されることで9枚の入力画像が取得される。ここでは、たとえば500×500画素程度の解像度の画像が入力されるものとする。
<Operation flow>
(Overall operation)
FIG. 12 is a flowchart showing an operation flow in the
入力画像が取得されると、ピクセル単位(整数画素)での位置ずれを推定する処理が実行される(ステップS1)。ステップS1では、環境変化(温度変化等)や部材の変形などによる位置ずれが推定される。次に、好ましくは、サブピクセル単位(小数画素)での位置ずれを推定する処理が実行される(ステップS2)。ステップS2での推定は後述する距離の推定精度を向上させるものではあるが、必須ではない。そして、位置ずれ量を考慮して視点から被写体までの距離が算出され(ステップS3)、その距離をパラメーターとして用いて距離に応じたぼけを付加することで、画像処理としてのリフォーカス処理が実行される(ステップS4)。なお、リフォーカス処理では距離が相対的に把握されればよい(距離の違いが認識できればよい)ため、ステップS3の距離算出では、必ずしも実際の距離の算出まで必要とはされず、相対的な距離、つまり、距離の違いを認識できる単位で算出されればよい。たとえば、距離の逆数や、視差を変換した数値でもよく、この説明ではそのような算出を距離算出と称する。リフォーカス処理後の画像が出力画像として生成される。 When the input image is acquired, a process for estimating the positional deviation in pixel units (integer pixels) is executed (step S1). In step S1, a positional shift due to an environmental change (temperature change or the like) or deformation of a member is estimated. Next, preferably, a process for estimating a positional deviation in sub-pixel units (decimal pixels) is executed (step S2). The estimation in step S2 improves the accuracy of distance estimation described later, but is not essential. Then, the distance from the viewpoint to the subject is calculated in consideration of the positional deviation amount (step S3), and the refocus processing as image processing is executed by adding blur corresponding to the distance using the distance as a parameter. (Step S4). In the refocusing process, the distance only needs to be relatively grasped (if the difference in distance is recognized), the distance calculation in step S3 does not necessarily require calculation of the actual distance, but the relative distance What is necessary is just to calculate by the unit which can recognize distance, ie, the difference in distance. For example, the reciprocal of the distance or a numerical value obtained by converting the parallax may be used. In this description, such calculation is referred to as distance calculation. An image after the refocus processing is generated as an output image.
(位置ずれ推定)
ステップS1の位置ずれ推定処理は、第1段階の推定処理として、参照画像に対して、基準画像の視点と算出画像の視点とのなす方向に対応した方向で、粗いピッチでテンプレートマッチングを行なう推定処理(#1)と、第2段階の推定処理として第1段階でのピッチよりも細かいピッチでテンプレートマッチングを行なう推定処理(#2)とを含む。図13および図14は、それぞれ、ステップS1での位置ずれ推定処理の第1の例および第2の例を説明するための図である。
(Position misalignment estimation)
The position deviation estimation process in step S1 is a first stage estimation process in which template matching is performed with a rough pitch in a direction corresponding to a direction formed by the reference image viewpoint and the calculated image viewpoint with respect to the reference image. The process (# 1) and the estimation process (# 2) for performing template matching at a finer pitch than the pitch in the first stage are included as the second stage estimation process. FIGS. 13 and 14 are diagrams for explaining a first example and a second example of the positional deviation estimation processing in step S1, respectively.
第1の例については、図13を参照して、まず、画像処理装置1は、1つの入力画像を基準画像、基準画像以外の入力画像であって温度変化のある入力画像を参照画像とする。そして、画像処理装置1は、基準画像中のテンプレート(図中の矩形枠)を、参照画像の対応する位置に対して、基準画像の視点(レンズ)の位置と参照画像の視点(レンズ)の位置とのなす方向で粗いピッチ(たとえば4画素刻み程度)でマッチングして対応位置を特定する粗推定(#1)を行なう。上記のように、温度変化による変形(ずれ)と視差の現れる方向とは概ね同じ方向であるためである。
For the first example, referring to FIG. 13, first, the
たとえば、レンズEからの入力画像Eを基準画像とし、レンズAからの入力画像Aを参照画像とする。そして、基準画像の位置(x,y)=(100,150)に対応する参照画像の画素位置を第1の例にかかる位置ずれ推定処理にて探索する場合を説明する。このとき、画像処理装置1は、基準画像の対応する位置に対して、(-4,-4),(0,0),(4,4),(8,8),(12,12),(16,16),(20,20),(24,24)だけずらした8画素でテンプレートマッチングを行なう。すなわち、画像処理装置1は、基準画像の位置(x,y)=(96,146),(100,150),(104,154),(108,158),(112,162),(116,166),(120,170),(124,174)でテンプレートマッチングを行なう。そして、画像処理装置1は、最も一致度の高い画素を特定する。なお、画像処理装置1は、参照画像とする入力画像の視差(レンズ)の位置(参照画像のレンズとなす角度)に応じて、上記したずらす画素の方向を切り替える。たとえば参照画像がレンズBからの入力画像Bである場合、画像処理装置1は、上下方向にたとえば4画素ピッチでずらしながらテンプレートマッチングを行なう。
For example, the input image E from the lens E is set as a standard image, and the input image A from the lens A is set as a reference image. A case will be described in which the pixel position of the reference image corresponding to the position (x, y) = (100, 150) of the standard image is searched by the positional deviation estimation processing according to the first example. At this time, the
なお、ここでのテンプレートマッチング処理の一例として、NCC(Normalized Cross Correlation)が挙げられる。他の例として、SAD(Sum of Absolute Difference)やSSD(Sum of Squared Difference)などであってもよい。 An example of the template matching process here is NCC (Normalized Cross Correlation). Other examples include SAD (Sum of Absolute Difference) and SSD (Sum of Squared Difference).
次に、画像処理装置1は、第1段階の推定処理(#1)でテンプレートに対して最も一度が高いと特定された位置の周辺を第1段階の推定処理(#1)よりも細かいピッチ(たとえば1画素刻み程度)でマッチングして対応位置を特定する精密推定(#2)を行なう。
Next, the
たとえば、第1段階の推定処理(#1)で特定された位置が(x,y)=(104,154)であった場合、画像処理装置1は、その画素の周辺を1画素の精度で平面的に探索(テンプレートマッチング)し、(x,y)=(102,155)のように一致する画素を特定する。
For example, when the position specified in the first stage estimation process (# 1) is (x, y) = (104, 154), the
「粗いピッチ」は、テンプレートマッチングを行なう画素のずらす方向に限定されない。第2の例として、テンプレートのサイズを第1段階の推定処理(#1)と第2段階の推定処理(#2)とで異ならせてもよい。すなわち、図14を参照して、画像処理装置1は、第1段階の推定処理(#1)では、入力画像が500×500画素の場合、65×65画素サイズのテンプレートを用いてテンプレートマッチングするものとする。この場合、好ましくは、画像処理装置1は、入力画像を500×500画素から縦横1/4のサイズに縮小して125×125画素サイズとし、その入力画像に対して17×17画素サイズのテンプレートを用いてテンプレートマッチングしてもよい。これにより、テンプレートマッチング処理を高速化することができる。また、好ましくは、画像処理装置1は、入力画像を500×500画素から縦横1/4のサイズに縮小して125×125画素サイズにする代わりに、4画素ごとの画素を抜き出して125×125画素サイズの低画素画像に変換し、その入力画像に対して17×17画素サイズのテンプレートを用いてテンプレートマッチングしてもよい。これにより、テンプレートマッチング処理をより高速化することができる。
“Rough pitch” is not limited to the direction of shifting pixels for template matching. As a second example, the size of the template may be different between the first stage estimation process (# 1) and the second stage estimation process (# 2). That is, referring to FIG. 14, in the first stage estimation process (# 1), the
さらに、画像処理装置1は、第2の例として、第2段階の推定処理(#2)において、第1段階の推定処理(#1)で特定された画素周辺を平面的に探索(テンプレートマッチング)する代わりに、縮小した画像を用いてピラミッド状に探索してもよい。すなわち、図14を参照して、第2段階の推定処理(#2)の第1のステップとして、画像処理装置1は、500×500画素の入力画像を縦横1/4のサイズに縮小して125×125画素サイズとし、その入力画像に対して17×17画素サイズのテンプレートを用いて特定された画素から±1画素の9か所に対してテンプレートマッチングを行なう。テンプレートマッチングの範囲は、縮小前の元画像の特定された画素から±4画素の範囲に相当する。次に、第2段階の推定処理(#2)の第2のステップとして、画像処理装置1は、500×500画素の入力画像を縦横1/2のサイズに縮小して250×250画素サイズとし、その入力画像に対して17×17画素サイズのテンプレートを用いて特定された画素から±1画素の9か所に対してテンプレートマッチングを行なう。テンプレートマッチングの範囲は、縮小前の元画像の特定された画素から±2画素の範囲に相当する。次に、第2段階の推定処理(#2)の第3のステップとして、画像処理装置1は、500×500画素の入力画像を縮小することなく17×17画素サイズのテンプレートを用いて特定された画素から±1画素の9か所に対してテンプレートマッチングを行なう。なお、第1段階の推定処理(#1)と同様に、画像処理装置1は、縮小画像を生成する代わりに、入力画像を数画素ごとに抜き出して低画素画像に変換することで、テンプレートマッチング処理をより高速化することができる。
Further, as a second example, the
画像処理装置1が、上記ステップS1の位置ずれ推定処理にて、探索方向、探索ピッチを変えて、第1段階の推定処理(粗推定(#1))と第2段階の推定処理(精密推定(#2))とを実行することで、推定精度を落とすことなくテンプレートマッチングの回数(探索回数)を削減することができる。そのため、ピクセルレベルで高速に位置ずれを推定(対応画素を探索)することができる。
The
(サブピクセル推定)
ステップS2のサブピクセル単位(小数画素)での位置ずれを推定する処理は、ステップS1の位置ずれ推定処理にて対応点として推定された画素の近傍の画素を含む画素群(たとえば周囲8画素を含む9画素)それぞれのテンプレートマッチングの一致度(たとえばNCC値)を算出する処理を含む。図15は、対応点として推定された画素およびその周囲8画素のNCC値の具体例を表わしている。
(Subpixel estimation)
The process of estimating the position shift in sub-pixel units (decimal pixels) in step S2 is a pixel group including pixels in the vicinity of the pixels estimated as corresponding points in the position shift estimation process in step S1 (for example, surrounding 8 pixels). 9 pixels) including processing for calculating the degree of matching (for example, NCC value) of each template matching. FIG. 15 shows a specific example of the NCC values of the pixels estimated as corresponding points and the surrounding eight pixels.
ステップS2では、それら一致度を元に2次曲面フィッティングが行なわれ、サブピクセル単位での位置ずれが推定される。ステップS2のサブピクセル単位(小数画素)での位置ずれ推定では、一例として、図16に表わされた、論文「位置ずれ量を考慮した画素選択に基づくロバスト超解像処理」(電子情報通信学会論文誌、Vol.J92-D、No.5、pp.650-660、2009、2009年5月)に記載された手法を採用することができる。すなわち、図15および図16に表わされたように、画素ごとの一致度のうち、最も一致度の高い画素の座標がずれ量として特定される。 In step S2, quadratic surface fitting is performed based on the degree of coincidence, and the positional deviation in units of subpixels is estimated. In the positional deviation estimation in sub-pixel units (decimal pixels) in step S2, as an example, the paper “Robust super-resolution processing based on pixel selection considering positional deviation amount” shown in FIG. 16 (electronic information communication) The method described in the academic journal, Vol. J92-D, No. 5, pp. 650-660, 2009, May 2009) can be employed. That is, as shown in FIG. 15 and FIG. 16, the coordinates of the pixel having the highest matching degree among the matching degrees for each pixel are specified as the shift amount.
なお、ステップS2では、上記の2次曲面フィッティングに替えて、X座標およびY座標それぞれで2次曲面フィッティングするなどの他の手法が採用されてもよい。 In step S2, instead of the quadric surface fitting described above, other methods such as quadric surface fitting using the X coordinate and the Y coordinate may be employed.
(距離算出)
図17は、入力画像ごとの基準画像(入力画像E)に対する対応画素のずれ量を画素値(色の濃淡)として表わした図である。図17では、基準画像(入力画像E)の視点からの視点の方向が斜め方向にある入力画像(入力画像A,C,G,I)については、X方向Y方向それぞれのずれ量を異なる画像で表わしている。画像処理装置1は、ステップS3の距離算出処理にて、一例として、図17に表わされている各入力画像のずれ量を加算する。
(Distance calculation)
FIG. 17 is a diagram illustrating the shift amount of the corresponding pixel with respect to the reference image (input image E) for each input image as a pixel value (color density). In FIG. 17, with respect to an input image (input images A, C, G, and I) in which the direction of the viewpoint from the viewpoint of the reference image (input image E) is oblique, the shift amounts in the X and Y directions are different. It is represented by As an example, the
図18(A)は、図17の各図に画素値で表わされた各入力画像のずれ量の、加算結果を表わした図である。図17に表わされたように、入力画像ごとにずれ量が異なるために全体的なオフセット量が異なるが、各入力画像のずれを表わす画素値をそのまま加算した画像が図18(A)となる。なお、基準画像である入力画像Eに対する入力画像Aの関係のように、視点(レンズ)の位置に応じて斜め方向にずれが現れる入力画像については、上記したようにX方向Y方向それぞれ加算する代わりに、視点(レンズ)方向に応じた斜め方向のずれを算出して加算してもよい。 FIG. 18A is a diagram showing the addition result of the shift amount of each input image represented by the pixel value in each diagram of FIG. As shown in FIG. 17, since the amount of shift differs for each input image, the overall offset amount differs. However, an image obtained by adding pixel values representing the shift of each input image as it is is shown in FIG. Become. In addition, as described above, for the input image in which a shift in the oblique direction occurs according to the position of the viewpoint (lens) as in the relationship of the input image A with respect to the input image E that is the reference image, the X direction and the Y direction are respectively added. Instead, an oblique shift according to the viewpoint (lens) direction may be calculated and added.
図18(A)において、画素値の高い(色の白い)画素ほどずれ量が大きく、画素値の低い(色の濃い)画素ほどずれ量が小さいことを表わしている。カメラから被写体までの距離が近いほどずれ量は大きくなり、距離が遠いほどずれ量は小さくなる。そのため、図18(A)において画素値の高い(色の白い)画素にある被写体ほどカメラから被写体までの距離が近く、画素値の低い(色の濃い)画素にある被写体ほどカメラから被写体までの距離が遠いことになる。従って、図18(A)は、カメラ22から被写体までの距離を表わす距離画像であると言える。
FIG. 18A shows that the shift amount is larger as the pixel value is higher (white color) and the shift amount is lower as the pixel value is lower (dark color). The closer the distance from the camera to the subject, the greater the amount of deviation, and the farther the distance, the smaller the amount of deviation. Therefore, in FIG. 18A, a subject having a high pixel value (white color) has a shorter distance from the camera to the subject, and a subject having a low pixel value (dark color) has a distance from the camera to the subject. The distance will be far. Accordingly, FIG. 18A can be said to be a distance image representing the distance from the
なお、図18(B)に、比較のために、温度変化がない場合の各入力画像のずれを表わす画素値をそのまま加算した画像を示す。図18(A)と図18(B)とを比較することで、カメラ22から被写体までの距離の相対量(距離の違い)は、レンズ22aが温度変化の影響を受けたとしても、温度変化の影響がない場合と同じ精度で認識できることが分かる。
For comparison, FIG. 18B shows an image obtained by adding pixel values representing the shift of each input image when there is no temperature change. By comparing FIG. 18A and FIG. 18B, the relative amount of distance from the
(リフォーカス処理)
リフォーカス処理は、準備処理として、距離画像を修正する処理と、カメラ22から被写体までの距離を段階分けする処理とを含む。図19は、ステップS4のリフォーカス処理のうちの準備処理の流れを表わした図である。図19を参照して、画像処理装置1は、距離画像を修正する処理として、入力画像のうちの1つの入力画像(入力画像E)を基準画像(図19(A))として生成された距離画像(図19(B))を、被写体ごとにカメラ22からの距離が何段階かに揃うように修正する(図19(C))。ここではたとえばジョイントバイラテラルフィルタが好適に用いられる。他の例として、近傍の画素を用い、色が近いほど大きな重み付けをした平均化フィルターが用いられてもよい。これにより、図19(B)の距離画像から図19(C)の距離画像が生成される。
(Refocus processing)
The refocus processing includes, as preparation processing, processing for correcting a distance image and processing for dividing the distance from the
次に、画像処理装置1は、カメラ22から被写体までの距離を段階分けする処理として、一例として、修正後の距離を8段階に分割する。これにより、図19(C)の距離画像から図19(D)の距離画像が生成される。
Next, as an example, the
図20は、リフォーカス処理の流れを表わした図である。画像処理装置1は、リフォーカス処理を行なって、図19(D)を元にぼけを付加したリフォーカス画像を作成する。図20を参照して、たとえば、撮影画像の右下の被写体(ぬいぐるみ)にピントを合わせたリフォーカス画像を作成する場合を説明する。この場合、画像処理装置1はリフォーカス処理を行なって、ピントを合わせる被写体とは異なる距離の被写体部分ほど強いぼけを付加する。なお、ぼけを付加した画像の生成方法の一例として、入力画像に対して平滑化フィルターを適用する方法が挙げられる。平滑化フィルターとしては、たとえば、ガウシアンフィルターや平均化フィルターなどが挙げられる。以下の説明では、3×3の平均化フィルターを複数回、用いる場合を例に挙げる。複数回、用いる代わりに、5×5、7×7などカーネルサイズを大きくしてもよい。
FIG. 20 is a diagram showing the flow of refocus processing. The
なお、好ましくは、画像処理装置1は、遠くの距離に相当するぼけから順に、合成する。これにより、人が見た時の同様のぼけを画像上に表現でき、表示品質を向上させることができる。
Note that preferably, the
図21~図23は、画像処理装置1にて上記の処理を行なって生成したリフォーカス画像の具体例を表わした図である。図21はカメラ22からの距離の近い、画面左下にある被写体にピントを合わせた画像、図22はカメラ22からの距離が中程度である、画面右下にある被写体にピントを合わせた画像、および図23はカメラ22からの距離が遠い、画面左上にある被写体にピントを合わせた画像を表わしている。
21 to 23 are diagrams showing specific examples of refocus images generated by performing the above-described processing in the
[第2の実施の形態]
第2の実施の形態にかかる画像処理装置1は、カメラ22に対して環境変化の一例としての温度変化があった場合であっても、入力画像を用いて画像処理の一例としての超解像処理を実行する。
[Second Embodiment]
The
<動作フロー>
図24は、本実施の形態にかかる画像処理装置1での動作の流れを表わすフローチャートである。図24を参照して、第1の実施の形態と同様に図5に表わされたレンズ22aそれぞれで入力画像を取得する処理が実行されることで9枚の入力画像が取得される。ここでは、たとえば500×500画素程度の解像度の画像が入力されるものとする。
<Operation flow>
FIG. 24 is a flowchart showing an operation flow in the
入力画像が取得されると、ピクセル単位(整数画素)での位置ずれを推定する処理が実行される(ステップS1’)。次に、好ましくは、サブピクセル単位(小数画素)での位置ずれを推定する処理が実行される(ステップS2’)。そして、位置ずれ量を考慮して、画像処理としての超解像処理が実行される(ステップS5)、1500×1500画素程度の高解像度画像が出力画像として生成される。 When the input image is acquired, a process for estimating the positional deviation in pixel units (integer pixels) is executed (step S1 '). Next, preferably, a process of estimating a positional deviation in sub-pixel units (decimal pixels) is executed (step S2 '). Then, super-resolution processing as image processing is executed in consideration of the amount of positional deviation (step S5), and a high-resolution image of about 1500 × 1500 pixels is generated as an output image.
(位置ずれ推定)
上記ステップS1’およびステップS2’での位置ずれ推定処理は、第1の実施の形態にかかる画像処理装置1でのステップS1およびステップS2での位置ずれ推定処理と同様である。しかしながら、第2の実施の形態にかかる画像処理装置1では、基準画像と参照画像とを入れ替えて同様の処理を行なう。
(Position misalignment estimation)
The positional deviation estimation processing in step S1 ′ and step S2 ′ is the same as the positional deviation estimation processing in step S1 and step S2 in the
図25および図26は、それぞれ、ステップS1’での位置ずれ推定処理の第1の例および第2の例を説明するための図である。第1の例および第2の例は、それぞれ、図13および図14で表わされた、第1の実施の形態での位置ずれ推定処理の第1例および第2の例に対応したものである。 FIG. 25 and FIG. 26 are diagrams for explaining a first example and a second example of the positional deviation estimation processing in step S1 ', respectively. The first example and the second example correspond to the first example and the second example of the misregistration estimation process in the first embodiment, which are shown in FIGS. 13 and 14, respectively. is there.
すなわち、図25を参照して、第2の実施の形態にかかる位置ずれ推定処理(ステップS1’)でも、画像処理装置1は、1つの入力画像を基準画像、基準画像以外の入力画像であって温度変化のある入力画像を参照画像として、基準画像中のテンプレートを、参照画像の対応する位置に対して、基準画像の視点(レンズ)の位置と参照画像の視点(レンズ)の位置とのなす方向で粗いピッチ(たとえば4画素刻み程度)でマッチングして対応位置を特定する粗推定(#1)を行なう。なお、第2の実施の形態では、画像処理装置1は、上記のように、基準画像と参照画像とを逆に用いる。すなわち、第2の実施の形態にかかる画像処理装置1は、第1の実施の形態で基準画像とした入力画像Eを参照画像として用い、第1の実施の形態で参照画像とした他の入力画像(たとえば入力画像A)を基準画像として用いる。そして、第2の実施の形態にかかる画像処理装置1は、第1の実施の形態と同様のテンプレートマッチングを行なう。
That is, with reference to FIG. 25, even in the misregistration estimation process (step S1 ′) according to the second embodiment, the
また、図26を参照して、第1の実施の形態と同様に、テンプレートのサイズを第1段階の推定処理(#1)と第2段階の推定処理(#2)とで異ならせてもよい。すなわち、画像処理装置1は、第1段階の推定処理(#1)では、入力画像が500×500画素の場合、65×65画素サイズのテンプレートを用いてテンプレートマッチングするものとする。さらに、画像処理装置1は、第2の例として、第2段階の推定処理(#2)において、第1段階の推定処理(#1)で特定された画素周辺を平面的に探索(テンプレートマッチング)する代わりに、図26に示されたように(第1の実施の形態と同様に)、縮小した画像を用いてピラミッド状に探索してもよい。なお、この場合も、第2の実施の形態にかかる画像処理装置1は、第1の実施の形態で基準画像とした入力画像Eを参照画像として用い、第1の実施の形態で参照画像とした他の入力画像(たとえば入力画像A)を基準画像として用いる。
Referring to FIG. 26, as in the first embodiment, the template size may be made different between the first stage estimation process (# 1) and the second stage estimation process (# 2). Good. That is, in the first stage estimation process (# 1), when the input image is 500 × 500 pixels, the
(超解像処理)
図27は、ステップS5での超解像処理の流れを表わした図である。図27では、具体例として、論文「Fast and Robust Multiframe Super Resolution」(IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 13, NO. 10, OCTOBER 2004 page.1327-1344)に記載された処理を行なう場合の超解像処理の流れが示されている。
(Super-resolution processing)
FIG. 27 is a diagram showing the flow of super-resolution processing in step S5. In FIG. 27, as a specific example, the paper “Fast and Robust Multiframe Super Resolution” (IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 13, NO. 10, OCTOBER 2004 page. 1327-1344) is described. The flow of resolution processing is shown.
図27を参照して、ステップ#31で、9枚の入力画像のうちの1枚に対してバイリニア法等の補間処理を施して入力画像の解像度を超解像処理後の解像度である高解像度に変換することで、初期画像としての出力候補画像が生成される。
Referring to FIG. 27, in
ステップ#32で、ノイズにロバストに収束させるための拘束項としてのBTV(Bilateral Total Variation)量が算出される。
In
ステップ#33で、上記生成された出力候補画像と9枚分の入力画像とが比較されて、残差が算出される。ステップ#34で、上記ステップ#31で生成された出力候補画像から算出された残差とBTV量とが減ぜられて次の出力候補画像が生成される。
In
上記ステップ#31~#34の処理が、出力候補画像が収束するまで繰り返され、収束した出力候補画像が超解像処理後の出力画像として出力される。 The processes in steps # 31 to # 34 are repeated until the output candidate image converges, and the converged output candidate image is output as an output image after the super-resolution processing.
繰り返しは、おおよそ充分に収束する回数(たとえば200回)などの、予め規定された回数であってもよいし、一連の処理の都度、収束判定がなされ、その結果に応じて繰り返されてもよい。 The number of iterations may be a predetermined number of times such as the number of times of convergence (for example, 200 times), or a convergence determination may be made for each series of processing, and may be repeated according to the result. .
図28は、上記ステップ#33で用いられる劣化情報を説明するための図である。また、図29~図33は、上記ステップ#33での処理を説明するための図である。
FIG. 28 is a diagram for explaining the deterioration information used in
劣化情報とは、超解像処理後の高解像度画像に対する入力画像それぞれの関係を表わす情報を指し、たとえば行列形式で表わされる。劣化情報には、入力画像それぞれのサブピクセルレベルでのずれ量F(平行移動した残りの少数画素分)、ダウンサンプリング量D(上記の例では縦横それぞれ1/3)、およびぼけ量H(PSF)などが含まれる。 Deterioration information refers to information representing the relationship of each input image with respect to a high-resolution image after super-resolution processing, and is represented, for example, in a matrix format. Degradation information includes a shift amount F (for the remaining small number of translated pixels) of each input image, a downsampling amount D (1/3 in each of the vertical and horizontal directions in the above example), and a blur amount H (PSF). ) Etc. are included.
図28を参照して、劣化情報は、入力画像および超解像処理後の高解像度画像それぞれを1次元のベクトル表現した場合に、その変換を示す行列で規定される。 Referring to FIG. 28, the deterioration information is defined by a matrix indicating the conversion when each of the input image and the high-resolution image after super-resolution processing is expressed as a one-dimensional vector.
上記ステップ#33では、まず、図29を参照して、入力画像Ykから生成された出力候補画像Xnにその入力画像Ykについての劣化情報DkHkFkを当てはめることで、入力サイズの画像DkHkFkXnが生成される(ステップ#41)。ここでの処理は、詳しくは、図30を参照して、まず、出力候補画像Xnに対して、ぼけ量Hkを表わすパラメーターであるPSFを係数とした行列を用いたフィルター処理が施される(ステップS11)。
In
そして、次に、ずれを考慮してダウンサンプリングされる(ステップS12)。これにより、入力サイズの画像DkHkFkXnが出力される。一例として、図30の右に表わされたように、ずれ量FがX方向に1/3画素のずれであり、ダウンサンプリング量Dが縦横1/3である場合には、フィルター処理された後の出力候補画像Xnの1/3画素分ずらした位置にある9画素分の矩形領域の各画素の平均値が、入力サイズの画像DkHkFkXnの1/3画素分ずらす前の位置にある1画素分の画素値として出力される(ステップS13)。 Then, down-sampling is performed in consideration of the deviation (step S12). As a result, an input size image DkHkFkXn is output. As an example, as shown on the right side of FIG. 30, when the shift amount F is a shift of 1/3 pixel in the X direction and the downsampling amount D is 1/3 vertical and horizontal, it is filtered. One pixel at which the average value of the pixels in the rectangular area of nine pixels at the position shifted by 1/3 pixel of the subsequent output candidate image Xn is shifted by 1/3 pixel of the input image DkHkFkXn Is output as a minute pixel value (step S13).
次に、図31を参照して、入力サイズの画像とされた出力候補画像DkHkFkXnは入力画像Ykと比較され、その差異の画像sign(DkHkFkXn-Yk)が記録される(ステップ#42)。図31の例では、一例として、出力候補画像DkHkFkXnと入力画像Ykとの差異に符号関数signが適用される例が示されている。 Next, referring to FIG. 31, the output candidate image DkHkFkXn, which is an input size image, is compared with the input image Yk, and an image sign (DkHkFkXn-Yk) of the difference is recorded (step # 42). In the example of FIG. 31, as an example, an example in which the sign function sign is applied to the difference between the output candidate image DkHkFkXn and the input image Yk is shown.
次に、超解像処理の収束演算に用いられるように、上記の差異が超解像画像のどの画素の影響によるものであるのか、算出された差異に表わされる影響を超解像画像上の対応する画素に戻すために、上記差異の画像sign(DkHkFkXn-Yk)を超解像後の画像サイズに戻す処理が行なわれる(ステップ#43)。上記のように、劣化情報Dk,Hk,Fkを行列で定義した場合、ステップ#43ではその転置行列が用いられる。すなわち、図32を参照して、記録された差異の画像sign(DkHkFkXn-Yk)にその入力画像Ykについての劣化情報DkHkFkの転置行列DkTHkTFkTを当てはめることで、超解像後の画像サイズに戻される。ここでの処理は、詳しくは、図33を参照して、上記のようにして差異の画像sign(DkHkFkXn-Yk)が生成されると(ステップS14)、ずれを考慮してアップサンプリングされる(ステップS15)。一例として、図33の右に表わされたように、ずれ量FがX方向に1/3画素のずれであり、ダウンサンプリング量Dが縦横1/3である場合には、差異の画像sign(DkHkFkXn-Yk)の所定位置にある1画素分の画素値(差異の値)が均等分(この例では9等分)され、1/3画素分ずらした位置にある9画素分の矩形領域の各画素に出力される。この処理の後、ぼけ量Hkを表わすパラメーターであるPSFを係数としたフィルターの転置行列が当てはめられてぼけ量Hkの影響を戻す処理が施され(ステップS16)、処理後の画像が超解像後の画像サイズに戻された差異の画像DkTHkTFkTsign(DkHkFkXn-Yk)が出力される(ステップS17)。以上の処理によって、1つの入力画像Ykに対する差異の画像DkTHkTFkTsign(DkHkFkXn-Yk)が作成される。
Next, as used in the convergence calculation of the super-resolution processing, the influence of which pixel in the super-resolution image is affected by the above-described difference, and the influence represented by the calculated difference on the super-resolution image. In order to return to the corresponding pixel, processing for returning the image sign (DkHkFkXn−Yk) of the difference to the image size after super-resolution is performed (step # 43). As described above, when the deterioration information Dk, Hk, Fk is defined by a matrix, the transposed matrix is used in
図34は、上記ステップ#33の残差算出処理の一例を表わしたフローチャートである。入力画像はこの例では9枚あるため、上記ステップ#33の残差算出処理では図34のように枚数分、上記ステップS11~S17の処理を繰り返す。すなわち、図34を参照して、1枚目の入力画像Y1について上記の処理がステップS11~S17として行なわれて超解像後の画像サイズの差異の画像が出力され、2枚目の入力画像Y2について上記の処理がステップS21~S27として行なわれて超解像後の画像サイズの差異の画像が出力され、…(中略)、9枚目の入力画像Y9について上記の処理がステップS91~S97として行なわれて超解像後の画像サイズの差異の画像が出力される。
FIG. 34 is a flowchart showing an example of the residual calculation process in
そして、その合計値が残差として出力される(ステップS100)。なお、上の例では、ずれ量Fとぼけ量Hとの処理順が論文での説明とは逆になっているが、ぼけは画像のある程度大きな範囲で生じているため、順序を入れ替えても実質的な影響はない。 Then, the total value is output as a residual (step S100). In the above example, the processing order of the deviation amount F and the blur amount H is opposite to that described in the paper. However, since blur occurs in a certain large range of the image, the order is substantially changed even if the order is changed. There is no impact.
なお、上記のぼけ量Hの行列の処理は、以下のフィルター処理と等価となる。すなわち、ぼけ量Hの処理については、入力画素値I、出力画素値I’を用いて、
I’(x,y)=ΣΣPSF(i,j)I(x+i,y+j)
と表わされる。なお、Σは、PSFのフィルターサイズ分(たとえば7×7のフィルターなら、i,jそれぞれ-3~3)となる。
Note that the processing of the matrix of the blur amount H is equivalent to the following filter processing. That is, for the processing of the blur amount H, using the input pixel value I and the output pixel value I ′,
I ′ (x, y) = ΣΣ PSF (i, j) I (x + i, y + j)
It is expressed as Note that Σ is equal to the PSF filter size (for example, for a 7 × 7 filter, i and j are -3 to 3 respectively).
また、ぼけ量Hの転置行列の処理については、
I’(x+i,y+j)=ΣΣPSF(i,j)I(x,y)
と表わされる。つまり、出力画素値I’は、入力画素値Iを全画素処理した合計値となる。
Regarding the processing of the transpose matrix of the blur amount H,
I ′ (x + i, y + j) = ΣΣPSF (i, j) I (x, y)
It is expressed as That is, the output pixel value I ′ is a total value obtained by processing all the pixels of the input pixel value I.
なお、超解像処理は、図27に表わされた処理に限定されるものではなく、複数枚の入力画像から1枚の画像を生成する再構成型超解像処理であれば他の処理が採用されてもよい。図35は、上記ステップS5での超解像処理の他の例を表わした図である。すなわち、図35を参照して、上記ステップ#32で算出される拘束項はBTV量に替えて、たとえば、4近傍ラプラシアンなどの他のものが用いられてもよい(ステップ#32’)。
Note that the super-resolution processing is not limited to the processing shown in FIG. 27, and other processing is possible as long as it is a reconfigurable super-resolution processing that generates one image from a plurality of input images. May be adopted. FIG. 35 is a diagram showing another example of the super-resolution processing in step S5. That is, referring to FIG. 35, the constraint term calculated in
また、ステップ#33の残差算出処理も異なる算出方法であってよい。一例として、符号関数signを用いず、出力候補画像DkHkFkXnと入力画像Ykとの差異が直接用いられてもよい。
Also, the residual calculation process in
[第3の実施の形態]
上記の第1の実施の形態と第2の実施の形態とを組み合わせてもよい。すなわち、第3の実施の形態にかかる画像処理装置1は、カメラ22に対して環境変化の一例としての温度変化があった場合であっても、入力画像を用いて画像処理の一例としての超解像処理およびリフォーカス処理を実行する。
[Third Embodiment]
You may combine said 1st Embodiment and 2nd Embodiment. In other words, the
図36は、本実施の形態にかかる画像処理装置1での動作の流れを表わすフローチャートである。第3の実施の形態にかかる画像処理装置1は、第1の実施の形態にかかる画像処理であるリフォーカス処理と、第2の実施の形態にかかる画像処理である超解像処理とをそれぞれ入力画像に対して行なうことでリフォーカス画像と超解像画像とを得、それらを合成する。すなわち、図36を参照して、第1の実施の形態にかかる画像処理装置1でのステップS1~S4(図12)の処理と、第2の実施の形態にかかる画像処理装置1でのステップS1’,S2’(図24)の処理とを、それぞれ、入力画像に対して行なって、リフォーカス画像と超解像画像とを得る。なお、図36に表わされたように、リフォーカス画像と超解像画像とでは画素サイズが異なる。そこで、画像処理装置1は、ステップS1~S4の処理で得られたリフォーカス画像に対してたとえばバイリニア補間などの解像度変換を施した後に(ステップS6)、超解像画像と合成する(ステップS7)。
FIG. 36 is a flowchart showing an operation flow in the
図37は、ステップS7での合成処理について説明するための図である。図37を参照して、画像処理装置1は、リフォーカス画像のうちのステップS4のリフォーカス処理の際にぼけを付加した画素(領域)については、リフォーカス画像のうちのステップS6で解像度変換された画素を用いる。
FIG. 37 is a diagram for explaining the composition processing in step S7. Referring to FIG. 37,
一方、リフォーカス画像のうちのピントを合わせた領域については、そのうちの最もピントのあった領域(画素)のみ、ステップS5の超解像処理によって得られた画素をそのまま用いる。最もピントを合わせた領域(画素)の周辺領域については、リフォーカス画像のうちのステップS5の超解像処理によって得られた画素をたとえば3×3の平均化フィルターを用いて平均化して用いる。リフォーカス処理の際に3×3の平均化フィルターを用いることは、超解像画像に対して9×9の平均化フィルターを用いて平均化することと解像度が実質的に同じになる。そのため、このように平均化することで、ぼけた領域と超解像された領域との間を滑らかに変化させることができる。なお、図37において3×3の平均化フィルターを用いて平均化する、リフォーカス画像のうちのピントを合わせた領域(画素)の周辺領域については、図38に表わされたように、リフォーカス画像を解像度変換して用いてもよい。 On the other hand, for the focused area in the refocus image, only the most focused area (pixel) is used as it is as the pixel obtained by the super-resolution processing in step S5. For the peripheral area of the most focused area (pixel), the pixels obtained by the super-resolution processing in step S5 in the refocus image are averaged using, for example, a 3 × 3 averaging filter. Using a 3 × 3 averaging filter during the refocusing process has substantially the same resolution as averaging a super-resolution image using a 9 × 9 averaging filter. Therefore, by averaging in this way, it is possible to smoothly change between the blurred area and the super-resolution area. As shown in FIG. 38, the peripheral area of the focused area (pixel) in the refocused image that is averaged using the 3 × 3 averaging filter in FIG. The focus image may be used after resolution conversion.
[第4の実施の形態]
第4の実施の形態にかかる画像処理装置1は、カメラ22に対して環境変化の一例としての温度変化があった場合であっても、入力画像を用いて画像処理を行なうことでカメラ22から被写体までの距離を精度よく算出する。
[Fourth Embodiment]
The
<動作フロー>
図39は、本実施の形態にかかる画像処理装置1での動作の流れを表わすフローチャートである。図39を参照して、第4の実施の形態にかかる画像処理装置1は、第1~第3の実施の形態にかかる画像処理装置1と同様にして位置ずれを推定した後(ステップS1)、位置ずれ量を補正する(ステップS8)。
<Operation flow>
FIG. 39 is a flowchart showing an operation flow in the
図40~図42は、ステップS8での位置ずれ量を補正する方法を説明するための図である。図40に示された、入力画像ごとの基準画像(入力画像E)に対する対応画素のずれ量を表わす距離画像では、画像ごとにずれ量が全体的に異なることが表わされている。そこで、画像処理装置1は、図41に表わされたように、画像ごとのずれ量の平均値を算出し、12個の平均値の中から最小値を特定する。そして、画像ごとの最小値からの差分を補正量とする。画像処理装置1は、画像ごとに、ずれ量から補正量を減じる。図42は、図40の各図を補正した結果を表わしている。この補正を行なうことで、各画像の平均値が、揃うことになる。
40 to 42 are diagrams for explaining a method of correcting the positional deviation amount in step S8. The distance image representing the shift amount of the corresponding pixel with respect to the reference image (input image E) for each input image shown in FIG. 40 indicates that the shift amount is entirely different for each image. Therefore, as shown in FIG. 41, the
図39に戻って、画像処理装置1は、ステップS8の補正後の画像から間違いのデータ(ノイズ)を抽出する(ステップS9)。図43~図45は、ステップS9での間違いデータを抽出する方法を説明するための図である。画像処理装置1は、補正後の12枚の画像の対応する画素位置についてのヒストグラムを作成する。そして、画像処理装置1は、ヒストグラムから外れた画素値(ずれ量)を間違いと判定する。画像処理装置1は、各図について、たとえば3画素ピッチでヒストグラムを作成するなどして、画像全体を判定する。
39, the
図44は、図43の12枚の画像各図の右上の丸印部分について、対応する画素位置ごとに作成されたヒストグラムを表わしている。画像処理装置1は、図44のヒストグラムにおいて、連続した2つの画素値でのヒストグラム値の最大となる箇所を特定し、その箇所以外の画素値は間違いデータと判定する。図44のヒストグラムでは、ヒストグラム値の最大となる箇所が画素値0~6である箇所Aと特定され、この箇所Aに示された画素値を有する画素は正しい(適切な画素値を有する画素)と判定される。画素値30付近である箇所Bのヒストグラム値は間違いデータと判定される。
FIG. 44 shows a histogram created for each corresponding pixel position with respect to the circle at the upper right of each of the 12 images in FIG. The
図45は、図43の12枚の画像各図についての間違いデータの判定結果を表わした図である。図中の白領域が、間違いデータであると判定された画素値の領域を表わしている。 45 is a diagram showing the determination result of the error data for each of the 12 images in FIG. A white area in the figure represents an area having a pixel value determined to be erroneous data.
再び図39に戻って、画像処理装置1は、ステップS9で上記した方法で入力画像それぞれについて間違いデータ(ノイズ)を判定すると、各図の間違いデータとされた画素を除いた画素を用いて加算処理を行なうことで、距離を推定する(ステップS10)。図46は、図45で白色で表わされた画素を除いた各図を加算することで得られた距離画像を表わしている。
Returning again to FIG. 39, when the
ステップS10での加算処理では、全入力画像とも正しいと判定された画素はそのまま加算するものの、例えば図44のヒストグラムで示されたように12枚の画像中の10枚だけが正しいと判定されている画素は、10枚分を加算した後、12/10倍して画素の重みを合わせる。 In the addition processing in step S10, pixels that are determined to be correct for all input images are added as they are. However, for example, as shown in the histogram of FIG. 44, only 10 of 12 images are determined to be correct. 10 pixels are added and then multiplied by 12/10 to match the pixel weight.
図18(A)のすべての画像を加算して生成した距離画像と図46の上記の処理で生成した距離画像とを比較すると、図46の距離画像では、図18(A)の距離画像の左上や右上に現れていた画素値が間違いデータ(ノイズ)として除かれている。これより、ステップS10で間違いデータを除去した上で加算することでより正しい距離画像を作成できていることが分かる。 When the distance image generated by adding all the images in FIG. 18A is compared with the distance image generated by the above processing in FIG. 46, the distance image in FIG. Pixel values appearing in the upper left and upper right are removed as erroneous data (noise). From this, it can be seen that the correct distance image can be created by adding after removing the erroneous data in step S10.
[変形例1]
以上の説明では、環境条件の変化の一例としての温度変化により画素が想定している対応位置からずれてしまうことが想定されているが、環境変化は温度変化には限定されない。他の例として、図示しないレンズ22aの保持部などの機械的な部品の経時変化(伸び、たわみ、等)が挙げられる。その場合も、画像処理装置1は上記ステップS1と同様にして対応点探索を行なうことができる。また、第1の実施の形態にて説明したようにキャリブレーション(歪曲補正や平行化処理)を行なわない場合などでも適応できる。すなわち、何らかの誤差要因があれば、画像処理装置1は、その誤差精度に合わせて2段階に探索方向をおよび探索ピッチを切り替えて、対応画素を探索することで適応できる。
[Modification 1]
In the above description, it is assumed that the pixel shifts from the corresponding position assumed by the pixel due to the temperature change as an example of the change in the environmental condition. However, the environmental change is not limited to the temperature change. Another example is a change with time (elongation, deflection, etc.) of a mechanical part such as a holding part of the
[変形例2]
以上の説明では、画像処理装置1が図5のようにレンズの配置されたアレイカメラであるカメラ22からの入力画像を用いるものとしているが、レンズは図5のものに限定されない。図47および図48は、カメラ22に含まれるレンズの他の例を表わした図である。すなわち、上記の説明では、アレイレンズA~Pが四隅で保持されていることが想定されている。しかしながら、図47のように、四隅のうちの1か所(たとえば左上)のみでアレイレンズA~Pが保持されていてもよい。この場合、図47に示されるように、各レンズの変形は非対称であって、保持されている隅を中心とした略放射状に変形することになる。しかしながら、保持されている隅に最も近いレンズAを基準とした各レンズの位置ずれは、図6での説明と同様に、レンズAを中心として各レンズからの入力画像の視差の方向(レンズの配置方向)に伸び縮みする。そのため、こういった場合であっても、画像処理装置1は、上記ステップS1と同様の位置ずれ推定処理を行なうことで対応点を探索することができる。
[Modification 2]
In the above description, the
また、図48のように、カメラ22に含まれるレンズ22aが16個(16眼)の場合も、温度変化などの環境変化により各レンズ22aの位置ずれの方向は、図6での説明と同様に、基準とするレンズと対象とするレンズとのなす方向(視差方向)である。そのため、こういった場合であっても、画像処理装置1は、上記ステップS1と同様の位置ずれ推定処理を行なうことで対応点を探索することができる。
Also, as shown in FIG. 48, when the number of
<実施の形態の効果>
アレイカメラであるカメラ22に含まれるレンズ22aが温度変化などの環境変化の影響を受けると全体として伸び縮みしてレンズ間隔(ピッチ)が変動することがある。特に、レンズ22aやその保持部材がプラスチックなどの環境の影響を受けやすい素材である場合には、その変動が現れやすくなる。しかしながら、その変動は必ずしも全体的に均等に生じるものではない。そのため、距離算出処理や超解像処理やリフォーカス処理などの画像処理のために必要な対応点は、非対称にずれる場合がある。
<Effect of Embodiment>
When the
本実施の形態にかかる画像処理装置1は、対応点探索において、各レンズの配置方向(視差の現れる方向)と温度変化によるピッチ変動の方向とがおおよそ同じ方向である、という特徴を利用して、第一段階として粗い精度(ピッチ)でその方向に探索し、第二段階として一致すると探索された画素周辺で第一段階よりも細かい精度(ピッチ)で方向を制限せず平面的に探索する。これにより、高速かつ高精度で対応点を探索することができる。
The
今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて請求の範囲によって示され、請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。 The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.
1 画像処理装置、2 撮像部、3 画像処理部、4 画像出力部、22 カメラ、22a レンズ、22b 撮像素子、24 A/D変換部、31 前処理部、32 位置ずれ推定部、33 処理部、100 デジタルカメラ、102 CPU、104 デジタル処理回路、106 画像処理回路、108 画像表示部、112 記憶部、114 カメラ部、200 パーソナルコンピューター、202 パーソナルコンピューター本体、204 画像処理プログラム、206 モニター、208 マウス、210 キーボード、212 外部記憶装置、321 第1推定部、322 第2推定部、323 第3推定部。
DESCRIPTION OF
Claims (10)
前記基準画像以外の入力画像の前記1画素に対応する位置から、前記基準画像の視点と前記基準画像以外の入力画像の視点とのなす方向に対応した方向で第1のピッチでテンプレートマッチングを行なうことで、前記1画素に対応する画素を推定するための第1の推定部と、
前記第1の推定部で推定された画素に対して、前記第1のピッチよりも細かい第2のピッチでテンプレートマッチングを行なうことで、前記1画素に対応する画素を推定するための第2の推定部とを備える、画像処理装置。 One input image of a multi-viewpoint input image group each having a common partial area is used as a reference image, and a corresponding pixel in an input image other than the reference image is estimated for one pixel on the reference image. An image processing apparatus,
Template matching is performed at a first pitch in a direction corresponding to a direction between the viewpoint of the reference image and the viewpoint of the input image other than the reference image from a position corresponding to the one pixel of the input image other than the reference image. A first estimation unit for estimating a pixel corresponding to the one pixel;
A second pixel for estimating a pixel corresponding to the one pixel is obtained by performing template matching on the pixel estimated by the first estimating unit at a second pitch smaller than the first pitch. An image processing apparatus comprising: an estimation unit.
前記基準画像以外の入力画像の前記1画素に対応する位置から、前記基準画像の視点と前記基準画像以外の入力画像の視点とのなす方向に対応した方向で第1のピッチでテンプレートマッチングを行なうことで、前記1画素に対応する画素を推定するステップと、
推定された画素に対して、前記第1のピッチよりも細かい第2のピッチでテンプレートマッチングを行なうことで、前記1画素に対応する画素を推定するステップとを備える、画像処理方法。 One input image of a multi-viewpoint input image group each having a common partial area is used as a reference image, and a corresponding pixel in an input image other than the reference image is estimated for one pixel on the reference image. A method,
Template matching is performed at a first pitch in a direction corresponding to a direction between the viewpoint of the reference image and the viewpoint of the input image other than the reference image from a position corresponding to the one pixel of the input image other than the reference image. A step of estimating a pixel corresponding to the one pixel;
An image processing method comprising: estimating a pixel corresponding to the one pixel by performing template matching on the estimated pixel at a second pitch smaller than the first pitch.
前記基準画像以外の入力画像の前記1画素に対応する位置から、前記基準画像の視点と前記基準画像以外の入力画像の視点とのなす方向に対応した方向で第1のピッチでテンプレートマッチングを行なうことで、前記1画素に対応する画素を推定するステップと、
推定された画素に対して、前記第1のピッチよりも細かい第2のピッチでテンプレートマッチングを行なうことで、前記1画素に対応する画素を推定するステップとを前記コンピューターに実行させる、画像処理プログラム。 In a computer, one input image of a multi-viewpoint input image group each having a common partial area is set as a reference image, and one pixel on the reference image corresponds to an input image other than the reference image. A program for executing a process for estimating
Template matching is performed at a first pitch in a direction corresponding to a direction between the viewpoint of the reference image and the viewpoint of the input image other than the reference image from a position corresponding to the one pixel of the input image other than the reference image. A step of estimating a pixel corresponding to the one pixel;
An image processing program that causes the computer to execute a step of estimating a pixel corresponding to the one pixel by performing template matching on the estimated pixel at a second pitch smaller than the first pitch. .
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2015519825A JPWO2014192642A1 (en) | 2013-05-28 | 2014-05-23 | Image processing apparatus and image processing method |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2013-111822 | 2013-05-28 | ||
| JP2013111822 | 2013-05-28 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2014192642A1 true WO2014192642A1 (en) | 2014-12-04 |
Family
ID=51988675
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/JP2014/063648 Ceased WO2014192642A1 (en) | 2013-05-28 | 2014-05-23 | Image processing device and image processing method |
Country Status (2)
| Country | Link |
|---|---|
| JP (1) | JPWO2014192642A1 (en) |
| WO (1) | WO2014192642A1 (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS63292375A (en) * | 1987-05-26 | 1988-11-29 | Yaskawa Electric Mfg Co Ltd | Matching method for hierarchized structural template |
| JP2005167484A (en) * | 2003-12-01 | 2005-06-23 | Japan Science & Technology Agency | Image composition apparatus and image composition method |
| JP2008216127A (en) * | 2007-03-06 | 2008-09-18 | Konica Minolta Holdings Inc | Distance image generation device, distance image generation method, and program |
| WO2009001563A1 (en) * | 2007-06-28 | 2008-12-31 | Panasonic Corporation | Imaging device and semiconductor circuit device |
| JP2011185720A (en) * | 2010-03-08 | 2011-09-22 | Ricoh Co Ltd | Distance obtaining device |
-
2014
- 2014-05-23 WO PCT/JP2014/063648 patent/WO2014192642A1/en not_active Ceased
- 2014-05-23 JP JP2015519825A patent/JPWO2014192642A1/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS63292375A (en) * | 1987-05-26 | 1988-11-29 | Yaskawa Electric Mfg Co Ltd | Matching method for hierarchized structural template |
| JP2005167484A (en) * | 2003-12-01 | 2005-06-23 | Japan Science & Technology Agency | Image composition apparatus and image composition method |
| JP2008216127A (en) * | 2007-03-06 | 2008-09-18 | Konica Minolta Holdings Inc | Distance image generation device, distance image generation method, and program |
| WO2009001563A1 (en) * | 2007-06-28 | 2008-12-31 | Panasonic Corporation | Imaging device and semiconductor circuit device |
| JP2011185720A (en) * | 2010-03-08 | 2011-09-22 | Ricoh Co Ltd | Distance obtaining device |
Also Published As
| Publication number | Publication date |
|---|---|
| JPWO2014192642A1 (en) | 2017-02-23 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP6957197B2 (en) | Image processing device and image processing method | |
| JP5429358B2 (en) | Ghost detection device, imaging device using the same, ghost detection method, and ghost removal method | |
| JP6168794B2 (en) | Information processing method and apparatus, program. | |
| JP6347675B2 (en) | Image processing apparatus, imaging apparatus, image processing method, imaging method, and program | |
| JP6553826B1 (en) | Image processing apparatus, image processing method, and image processing program | |
| JP5978949B2 (en) | Image composition apparatus and computer program for image composition | |
| JP5500163B2 (en) | Image processing system, image processing method, and image processing program | |
| WO2013145554A1 (en) | Image processing apparatus and image processing method | |
| JP2015148532A (en) | Distance measuring device, imaging apparatus, distance measuring method, and program | |
| WO2011099647A1 (en) | Image processing device | |
| WO2014132754A1 (en) | Image-processing device and image-processing method | |
| JP2014164574A (en) | Image processor, image processing method and image processing program | |
| US20150161771A1 (en) | Image processing method, image processing apparatus, image capturing apparatus and non-transitory computer-readable storage medium | |
| US11438570B2 (en) | Data processing apparatus and data processing method for generation of calibration data for performing image processing | |
| US10122939B2 (en) | Image processing device for processing image data and map data with regard to depth distribution of a subject, image processing system, imaging apparatus, image processing method, and recording medium | |
| JP6153318B2 (en) | Image processing apparatus, image processing method, image processing program, and storage medium | |
| JP5587322B2 (en) | Image processing apparatus, image processing method, and image processing program | |
| JP5446285B2 (en) | Image processing apparatus and image processing method | |
| WO2014077024A1 (en) | Image processing device, image processing method and image processing program | |
| WO2014192642A1 (en) | Image processing device and image processing method | |
| JP2010041416A (en) | Image processing unit, image processing method, image processing program, and imaging apparatus | |
| WO2013011797A1 (en) | Degradation restoration system, degradation restoration method and program | |
| JP2011082614A (en) | Image processing device, and imaging device | |
| JP7009219B2 (en) | Image processing method, image processing device, image pickup device, image processing program, and storage medium | |
| JP6566765B2 (en) | Imaging device |
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: 14804618 Country of ref document: EP Kind code of ref document: A1 |
|
| ENP | Entry into the national phase |
Ref document number: 2015519825 Country of ref document: JP Kind code of ref document: A |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 14804618 Country of ref document: EP Kind code of ref document: A1 |