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

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

Info

Publication number
WO2012073575A1
WO2012073575A1 PCT/JP2011/070832 JP2011070832W WO2012073575A1 WO 2012073575 A1 WO2012073575 A1 WO 2012073575A1 JP 2011070832 W JP2011070832 W JP 2011070832W WO 2012073575 A1 WO2012073575 A1 WO 2012073575A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
value
unit
parallax
blurred
Prior art date
Application number
PCT/JP2011/070832
Other languages
English (en)
French (fr)
Inventor
紫村 智哉
田中 誠一
真一 有田
岡本 卓也
安本 隆
Original Assignee
シャープ株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by シャープ株式会社 filed Critical シャープ株式会社
Priority to BR112013013356A priority Critical patent/BR112013013356A2/pt
Priority to CN2011800582100A priority patent/CN103238168A/zh
Priority to JP2012546719A priority patent/JP5473173B2/ja
Priority to US13/990,464 priority patent/US9070223B2/en
Publication of WO2012073575A1 publication Critical patent/WO2012073575A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/73Deblurring; Sharpening
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10028Range image; Depth image; 3D point clouds

Definitions

  • the present invention relates to an image processing apparatus, an image processing method, and an image processing program.
  • This application claims priority based on Japanese Patent Application No. 2010-270735 filed in Japan on December 3, 2010, the contents of which are incorporated herein by reference.
  • the image generating apparatus When generating an image having a depth, the image generating apparatus has an image with a clear outline for an object in the focal region of the camera with respect to the depth direction of the image, and for an object outside the focal region of the camera. An image with a blurred outline is generated. As a result, the image generation device generates an image that expresses the perspective in a form close to the real world.
  • Patent Document 1 describes a parallax estimation method for estimating a parallax that changes discontinuously in an object outline.
  • This parallax estimation method calculates the initial parallax of two images and the reliability evaluation value of the initial parallax, and is set so that the parallax in the region where the initial parallax is low is smoothly connected to the surrounding parallax
  • the object contour line is determined so as to change.
  • Patent Document 2 describes an image generation system that generates a focused image such as a real-world view image. This image generation system sets an ⁇ value corresponding to the depth value of each pixel of the original image, and synthesizes the original image and the blurred image corresponding to the original image based on the ⁇ value set for each pixel. By doing so, a focused image is generated.
  • Patent Document 3 describes an image processing program for generating a focused image according to the distance from the viewpoint.
  • the image processing program includes a setting step for setting an ⁇ value of each pixel according to a depth value of each pixel of the reference image, and an ⁇ value set to a pixel having a smaller ⁇ value among two adjacent pixels. And an increasing step. Then, the image processing program combines the reference image and the blurred image corresponding to the reference image based on the ⁇ value set for each pixel after the processing in the increasing step, thereby generating the focused image. Generate.
  • the parallax value is the number of pixels in which the target point captured in the images is separated in the horizontal direction in the images captured at the positions of the two observation points.
  • a conventional image generation device When a conventional image generation device generates a composite image that combines a reference image and a blurred image by generating an expanded parallax map that is larger than the size of the subject, in the composite image, near the boundary between the subject and the background
  • the background image of is clear.
  • the conventional image generation apparatus has a problem of unnatural blurring in the boundary region between the subject and the background. This problem has not been solved in the image generation system or the image processing program described in Patent Document 2 and Patent Document 3.
  • the present invention has been made in view of the above problems, and an image processing apparatus, an image processing method, and an image processing apparatus capable of generating an image that is naturally blurred in a boundary region between a subject and a background or a foreground. It is an object to provide an image processing program.
  • an image processing apparatus includes a map filter processing unit that filters a parallax map based on a parallax value for each pixel of an image, and the image.
  • a blurred image generating unit that generates a blurred image of the image
  • an image combining unit that generates a combined image obtained by combining the image and the blurred image based on the parallax map after filtering by the map filter processing unit; Is provided.
  • the image processing apparatus may include a filter size selection unit that selects a size of an image filter according to the parallax map filtered by the map filter processing unit, and the blurred image generation unit includes: The blurred image may be generated by applying the image filter to the image.
  • the image processing apparatus may include a region dividing unit that divides the image into predetermined regions according to the parallax values and converts the parallax values for each of the regions, and the map filter processing unit includes: The parallax map in which the parallax value is converted by the region dividing unit may be filtered.
  • the image processing apparatus may include an image reduction unit that reduces the size of the image, and the blurred image generation unit may generate a blurred image of the image reduced by the image reduction unit.
  • An image enlargement unit that enlarges the blurred image of the reduced image to a predetermined size may be provided.
  • the blurred image generation unit selects a plurality of values from the parallax map, and generates a reference blurred image having a blur amount corresponding to each of the selected plurality of values.
  • a reference blur image for selecting a reference blur image from the reference blur image based on a comparison between the value of the parallax map after the filter of the target pixel and the selected value for each target pixel of the image
  • the selection unit Based on the selection unit, the pixel value of the pixel corresponding to the position of the target pixel in the selected reference blurred image, the value of the parallax map after filtering of the target pixel, and the selected value,
  • a pixel value interpolating unit that calculates the pixel value.
  • the pixel value interpolation unit includes a value based on a value of the parallax map after filtering of the target pixel and the selected value, and the target pixel of the selected reference blurred image.
  • the pixel value of the target pixel may be calculated by interpolation using the pixel value of the pixel corresponding to the position.
  • a parallax map based on a parallax value for each pixel of an image is filtered, a blurred image of the image is generated from the image, and the filtering is performed Based on the later parallax map, a synthesized image is generated by synthesizing the image and the blurred image.
  • an image processing program causes a computer of an image processing device to filter a parallax map based on a parallax value for each pixel of an image, and blurs the image from the image. And a synthesized image obtained by synthesizing the image and the blurred image is generated based on the parallax map after being filtered.
  • FIG. 1 is a block configuration diagram of an image processing apparatus according to a first embodiment of the present invention. It is a figure for demonstrating the detail of a process of the blurring coefficient calculation process part. It is the figure which showed the parallax value after LPF application when the horizontal width of the kernel size of LPF is larger than the horizontal width of the window size at the time of parallax map generation. It is the figure which showed the parallax value after LPF application in case the horizontal width of the kernel size of LPF is a half of the horizontal width of the window size at the time of parallax map generation.
  • FIG. 3 is a flowchart illustrating a processing flow of the image processing apparatus according to the first embodiment of the present invention. It is the flowchart which showed the flow of the process of the blurred image production
  • FIG. 1 is a diagram showing an outline of processing by an image processing apparatus in each embodiment of the present invention.
  • the input image 1 is an image in which a one-storied private house 100 (subject) in focus (the focus of the imaging device) exists in the center of the background area of the entire surface.
  • the parallax map 2 is an image in which the change in the parallax of the background area becomes smoother as the distance from the edge 101 of the focused private house 100 of the input image 1 moves away from the background area.
  • the parallax map 2 is obtained by applying an LPF (Low Pass Filter) to an image of the private house 100 that is a subject to smooth the change in the parallax between the edge 101 of the subject 100 and the background area.
  • LPF Low Pass Filter
  • the blurred background image 3 is an image obtained by extracting a blurred background image obtained by performing a blurring process on the background using the input image 1 and the parallax map 2.
  • the subject 4 is an image obtained by extracting the subject (private house 100) in the in-focus area using the input image 1 and the parallax map 2.
  • the output image 5 is an image obtained by combining the background blurred image 3 and the image of the subject 4 in the focused area. In the output image 5, the subject edge 101 and the boundary region of the background region are gently (naturally) blurred.
  • FIG. 2 is a schematic block diagram showing the configuration of the image processing apparatus 10 according to the first embodiment of the present invention.
  • the image processing apparatus 10 includes a storage unit 11, a parallax map generation unit 12, a blur coefficient calculation processing unit 20, a blur image generation processing unit 30, and an image composition unit 40.
  • the blur coefficient calculation processing unit 20 further includes a parallax value conversion unit (region division unit) 21 for each region, an LPF processing unit (sometimes referred to as a “filter processing unit”) 22, and a blur amount selection unit (filter). Size selection unit) 23.
  • the storage unit 11 includes information indicating the in-focus parallax value FF of the foreground boundary input from the outside, information indicating the focus parallax value FR of the background boundary, and the division width when the parallax value is divided into sections.
  • the kernel size WW of the LPF is a window size when the parallax map is generated.
  • One of the plurality of kernel sizes KS may be the same value as the kernel size WW of the LPF.
  • the number of kernel sizes KS stored in the storage unit 11 is the same as the number of blurred images to be generated.
  • the disparity map generation unit 12 uses known block matching using a predetermined window size (for example, the same size as the kernel size WW of the LPF) from the reference image data IMGDATA and the reference image data REFDATA input from the outside. By the method, a parallax map having a parallax value corresponding to the pixel position of each image is generated.
  • the parallax map generation unit 12 outputs the parallax value data DisparityData forming the generated parallax map to the parallax value conversion unit 21 for each area described later of the blurring coefficient calculation processing unit 20.
  • the blurring coefficient calculation processing unit 20 calculates the blurring amount GA (degree of blurring) based on the parallax value data DisparityData that forms the parallax map input from the parallax map generating unit 12. Then, the blur coefficient calculation processing unit 20 outputs information indicating the calculated blur amount GA and the parallax value d ′′ to the blur image generation processing unit 30.
  • the blurred image generation processing unit 30 generates a blurred image GP in the foreground area and the background area based on the input information indicating the blur amount GA and the reference image data IMGDATA.
  • FIG. 3 is a diagram for explaining the details of the process of the blurring coefficient calculation processing unit 20.
  • the parallax value conversion unit 21 for each region reads information indicating the focus parallax value FF of the foreground boundary and information indicating the focus parallax value FR of the background boundary from the storage unit 11.
  • the disparity value conversion unit 21 for each region has the disparity value data d after conversion when the value d of the disparity value data DisparityData input from the outside is smaller than the in-focus disparity value FR of the background boundary, that is, the background region. Let 'be FR-d.
  • the disparity value conversion unit 21 for each region sets the converted disparity value data d ′ to d -FF. Further, when the value d of the disparity value data DisparityData is equal to or greater than the in-focus disparity value FR of the background boundary and equal to or less than the in-focus disparity value FF of the foreground boundary, that is, the in-focus area, the disparity value conversion for each area The unit 21 sets the converted parallax value data d ′ to 0.
  • the parallax value conversion unit 21 for each area divides a parallax map that holds the parallax value of each pixel of the image into predetermined areas according to the parallax value, and converts the parallax value according to the area. Then, the parallax value conversion unit 21 for each region outputs the converted parallax value data d ′ to the LPF processing unit (map filter processing unit) 22.
  • the LPF processing unit (map filter processing unit) 22 reads information indicating the kernel size WW and information indicating the blur coefficient GC from the storage unit 11.
  • the LPF processing unit (map filter processing unit) 22 applies an LPF to the parallax map composed of the converted parallax value data d ′ using the read kernel size WW and the blur coefficient GC. Accordingly, the LPF processing unit (map filter processing unit) 22 smoothes the foreground region, the background region, and the in-focus region so that the parallax value does not change abruptly.
  • FIG. 4A to 4C are diagrams for explaining the kernel size WW used in the LPF processing unit (map filter processing unit) 22.
  • FIG. 4A is a diagram showing disparity values after applying the LPF when the widths 411 and 412 of the kernel size of the LPF are larger than the width of the window size at the time of generating the disparity map.
  • reference numeral 413 indicates the edge of the subject.
  • Reference numeral 414 indicates a parallax value after applying the LPF.
  • Reference numeral 415 indicates the background.
  • Reference numeral 416 indicates an expansion area corresponding to the half width of the window size.
  • FIG. 4A shows a parallax value before applying the LPF and a parallax value after applying the LPF with respect to the horizontal coordinate of the image (hereinafter referred to as an image abscissa).
  • the disparity value after applying the LPF indicated by being surrounded by a circle 417 is subjected to LPF as a background area although it is an in-focus area. Therefore, there is a problem that a part of the focus area of the synthesized image corresponding to the parallax value after applying the LPF indicated by the circle 417 is blurred.
  • FIG. 4B is a diagram illustrating disparity values after applying the LPF when the widths 421 and 422 of the kernel size of the LPF are half of the width of the window size at the time of generating the disparity map.
  • reference numeral 423 indicates the edge of the subject.
  • Reference numeral 424 indicates a parallax value after the LPF is applied.
  • Reference numeral 425 indicates the background.
  • Reference numeral 426 indicates an expansion region corresponding to the half width of the window size.
  • FIG. 4B shows the parallax value before applying the LPF and the parallax value after applying the LPF with respect to the image abscissa.
  • the parallax value after applying the LPF indicated by being surrounded by a circle 427 is not subjected to the LPF as the focusing area although it is the background area. Therefore, there is a problem that a part of the background area of the composite image corresponding to the parallax value after applying the LPF indicated by the circle 427 is not blurred.
  • FIG. 4C is a diagram showing disparity values after applying the LPF when the widths 431 and 432 of the kernel size of the LPF are the width of the window size at the time of generating the disparity map.
  • reference numeral 433 indicates the edge of the subject.
  • Reference numeral 434 indicates a parallax value after the LPF is applied.
  • Reference numeral 435 indicates the background.
  • Reference numeral 436 indicates an expansion region corresponding to the half width of the window size.
  • FIG. 4C shows the parallax value before applying the LPF and the parallax value after applying the LPF with respect to the horizontal coordinate of the image (hereinafter referred to as the image abscissa).
  • LPF is not applied to the in-focus area, and there is no problem that a part of the in-focus area of the final composite image is blurred. Further, LPF can be applied to the parallax value after conversion from the edge of the subject to the background. Therefore, it can be blurred from the edge of the subject of the final composite image to the background. Also, since the parallax value after applying the LPF changes gently from the subject edge toward the background, the blurring in the background area of the composite image changes gently.
  • the LPF processing unit (map filter processing unit) 22 applies the LPF to the parallax map with the same kernel size WW as the window size at the time of generating the parallax map, and calculates the parallax value d ′′ after applying the LPF.
  • the LPF processing unit (map filter processing unit) 22 outputs information indicating the parallax value d ′′ after LPF application to the blur amount selection unit 23.
  • FIG. 5A to 5C show the original parallax value d (FIG. 5A), the parallax value d ′ after conversion by parallax value conversion for each region (FIG. 5B), and the parallax value d ′′ after applying the LPF (FIG. 5C).
  • FIG. 5A shows an example of the relationship between the original parallax value and the image abscissa.
  • the horizontal axis is the image abscissa
  • the vertical axis is the parallax value d.
  • the left side (the one closer to the origin) is the foreground area
  • the middle is the in-focus area
  • the right side is the background area.
  • the foreground area has a high parallax value
  • the in-focus area has a medium parallax value
  • the background area has a low parallax value.
  • FIG. 5B shows an example of the parallax value after the conversion by the parallax value conversion for each region by the parallax value conversion unit 21 for each region with respect to the image abscissa.
  • FIG. 5B shows a case where disparity value conversion for each region is performed with respect to FIG. 5A.
  • the horizontal axis is the image abscissa
  • the vertical axis is the converted parallax value d '.
  • the left side is the foreground area
  • the middle is the in-focus area
  • the right side is the background area.
  • the parallax value d ′ after the conversion of the foreground area and the background area takes a positive value, whereas it takes 0 in the in-focus area.
  • the parallax value d ′ after the conversion changes rapidly with respect to the image abscissa.
  • FIG. 5C shows an example of the parallax value after the LPF is applied to the image abscissa by the LPF processing unit 22 according to the present embodiment.
  • the horizontal axis is the image abscissa
  • the vertical axis is the parallax value d ′′ after LPF application.
  • the left side is the foreground area
  • the middle is the in-focus area
  • the right side is the background area.
  • the parallax value d ′′ after the LPF is gently changed with respect to the image abscissa.
  • FIG. 5C shows a case where LPF processing is performed on FIG. 5B.
  • the LPF processing unit (map filter processing unit) 22 applies LPF to the parallax map.
  • the disparity value conversion unit 21 for each region divides the reference image into the foreground region, the background region, and the in-focus region, converts the disparity values, and then converts the LPF processing unit (map filter). (Processing unit) 22 performs LPF processing. Thereby, in the vicinity where the in-focus area and the background area in the composite image are in contact with each other, it is possible to prevent the occurrence of the contour due to the near-edge image of the in-focus area on the background area side.
  • the image processing apparatus 10 performs LPF processing (without changing the input parallax map) without performing parallax value conversion for each region, the parallax value does not become zero.
  • the image processing apparatus similarly performs the parallax value conversion for each area. If the LPF process is performed without changing the input parallax map, the parallax value becomes zero. For this reason, there is a problem that a focused image appears where there is no focused region in the synthesized image.
  • the parallax value conversion unit 21 for each region performs the parallax value conversion for each region, the converted foreground and background parallax values do not include the in-focus region parallax value. It will never be zero. Therefore, when the foreground region and the background region overlap in the composite image, when the image processing apparatus 10 performs the LPF process after performing the parallax value conversion for each region, a region where the parallax value is 0 is generated. Not.
  • the LPF processing unit 22 performs the LPF process. Thereby, it is possible to prevent a focused image from appearing in a region where the foreground region changes from the foreground region to the background region in the composite image.
  • the LPF processing unit (map filter processing unit) 22 filters the parallax map, the element value decreases from the center to the end of the tables T1 to T3 as shown in FIGS.
  • a kernel may be used.
  • the present invention is not limited to this, and the same kernel may be used for all elements of the kernel. For example, when the kernel is 3 ⁇ 3, all the elements may be 1/9.
  • the LPF processing unit (map filter processing unit) 22 filters the parallax value after applying the LPF so that the parallax value gradually changes from the position corresponding to the edge of the subject as shown in FIG. 4C. It is not limited to this.
  • the parallax value after applying the LPF may be filtered so that the parallax value gradually changes from a position corresponding to a pixel entering the inside of the subject rather than the edge of the subject as shown in FIG. 4A. In this case, the image starts to blur from the pixels that enter the subject.
  • the blur amount selection unit 23 reads information indicating the step width DW and information indicating a plurality of kernel sizes KS from the storage unit 11.
  • the blur amount selection unit 23 sets a threshold value for each step width DW by the same number as the number of types of the kernel size KS. For example, since the number of types of kernel size KS is 3, the blur amount selection unit 23 sets DW, DW ⁇ 2, and DW ⁇ 3 as threshold values.
  • the blurring amount selection unit 23 determines a blurring amount table for identifying a table that holds kernel information when the LPF is applied to the image. Set to 0 and set the in-focus flag FA.
  • the blur amount selection unit 23 sets the blur amount table to 1 and does not set the focus flag.
  • the blur amount selection 23 sets the blur amount table to 2 when the parallax value d ′′ after applying the LPF is smaller than twice the step width DW, that is, when the blur amount is medium. Don't flag. In cases other than the above, the blur amount selection 23 sets the blur amount table to 3 when the parallax value d ′′ after applying the LPF is smaller than three times the step width DW, that is, a strong blur amount, and sets the focus flag. can not stand.
  • the blur amount selection 23 sets the blur amount table to 4 and does not set the focus flag.
  • the blur amount selection unit 23 outputs information indicating the focus flag to the image synthesis unit 40, and blurs the image information processing unit 30 by combining information indicating the blur amount table GT and information indicating the parallax value d ′′ after LPF application. Output to.
  • the intervals between the step widths DW1 to DW3 shown in FIG. 3 do not have to be fixed lengths (the interval between the step widths DW is always constant), and may be variable.
  • the blurred image generation processing unit 30 generates a blurred image based on the information indicating the blur amount input from the blur amount selecting unit 23 and the reference image data IMGDATA input from the outside. To do. Then, the blurred image generation processing unit 30 outputs information indicating the blurred image GP to the image composition unit 40.
  • FIG. 9 is a block configuration diagram of the blurred image generation processing unit 30 (see FIG. 2).
  • the blurred image generation processing unit 30 includes a reference blurred image generation unit 31, a reference blurred image selection unit 32, and a pixel value interpolation unit 33.
  • the number of reference blurred images generated by the reference blurred image generation unit 31 is the number of types of kernel size KS.
  • the number of types of kernel size KS may be one or more.
  • each pixel value of the blurred image can be accurately interpolated from the reference blurred image. Therefore, the image processing apparatus 10 can generate a smooth blurred image corresponding to the distance to the subject.
  • the reference blurred image generation unit 31 generates three types of reference blurred images by convolving each of the blur coefficients GC of the kernels having three different kernel sizes with the reference image data IMGDATA supplied from the outside.
  • the reference blurred image generation unit 31 convolves the kernel of the table T1 (3 ⁇ 3) illustrated in FIG. 6 with the reference image data IMGDATA, thereby generating the first reference blurred image (weakly blurred image). Image).
  • the reference blurred image generation unit 31 generates a second reference blurred image (mid-blurred image) by convolving the kernel of the table T2 (7 ⁇ 7) shown in FIG. 7 and the reference image data IMGDATA. .
  • the reference blurred image generation unit 31 generates a third reference blurred image (strongly blurred image) by convolving the kernel of the table T3 (15 ⁇ 15) illustrated in FIG. 8 with the reference image data IMGDATA. .
  • FIG. 6 is a diagram illustrating an example of a kernel blur coefficient used when generating an image with a weak blur amount.
  • a 3 ⁇ 3 table T1 is shown as an example of a kernel blurring coefficient used to generate a blurred image (weak blur) corresponding to the step width DW1 of FIG.
  • the center element is the largest at 0.3446, and the elements at the four corners are the smallest at 0.0386.
  • FIG. 7 is a diagram illustrating an example of a kernel blurring coefficient used when generating an image with a medium blurring amount.
  • a 7 ⁇ 7 table T2 is shown as an example of a kernel blur coefficient used for generating a blur image (medium blur) corresponding to the step width DW2 of FIG.
  • the central element is the largest at 0.0324 among all the elements, the element is smaller toward the end, and the elements at the four corners are the smallest at 0.0103.
  • FIG. 8 is a diagram illustrating an example of a kernel blur coefficient used when generating an image with a strong blur amount.
  • a 15 ⁇ 15 table T3 is shown as an example of the kernel blurring coefficient used to generate the blurred image (strong blur) corresponding to the step width DW3 of FIG.
  • the central element is the largest at 0.006741 among all the elements, the element becomes smaller toward the end, and the elements at the four corners become the smallest at 0.002038. Yes.
  • the size of the table T2 is larger than the table T1. Therefore, the blurring amount of the image generated by convolving the kernel and the image shown in the table T2 is larger than the blurring amount of the image generated by convolving the kernel and the image shown in the table T1.
  • the size of the table T3 is larger than the table T2. Therefore, the blurring amount of the image generated by convolving the kernel and the image shown in the table T3 is larger than the blurring amount of the image generated by convolving the kernel and the image shown in the table T2.
  • the reference blurred image generation unit 31 outputs information indicating the generated three types of reference blurred images SG to the reference blurred image selection unit 32.
  • the reference blurred image selection unit 32 uses the information indicating the blur amount input from the blur amount selection unit 23 to select two blur images near the parallax value of the target pixel for each pixel of the blur image.
  • the reference blur image selection unit 32 selects a reference image and a weakly blurred image.
  • the reference blur image selection unit 32 selects a weak blur image and a medium blur image.
  • the reference blur image selection unit 32 selects a medium blur image and a strong blur image.
  • the reference blur image selection unit 32 selects only the strong blur image, and outputs the information indicating the strong blur image to the image synthesis unit 40 without being interpolated by the pixel value interpolation unit 33. .
  • the reference blurred image selection unit 32 outputs selection information indicating which blurred image has been selected to the pixel value interpolation unit 33.
  • the pixel value interpolating unit 33 selects the parallax value d ′′ of the two selected blurred images from the selection information indicating which blurred image is selected from the blurred images input from the reference blurred image selecting unit 32.
  • the information indicating the step width DW is read out.
  • the pixel value interpolation unit 33 calculates the pixel value of the blurred image corresponding to the parallax value of the target pixel by linear interpolation based on the read parallax value d ′′.
  • FIG. 10 is a diagram for explaining a method of calculating the pixel value of each pixel of the blurred image by linear interpolation.
  • the upper horizontal axis represents the pixel value (blurred image data) of the blurred image to be generated, and the lower horizontal axis represents the parallax value d ′′ after LPF application.
  • the input parallax value d ′′ IN which is one of the parallax values d ′′ after applying the LPF
  • the luminance value of the weak blur and Y 1 when the luminance value of the middle blur and Y 2, the luminance value of blurred image (interpolation data) Y is calculated by the following equation (1).
  • the pixel value interpolation unit 33 calculates the brightness value (interpolation data) of the blurred image for each brightness value of RGB (Red, Green, Blue) using Expression (1). Further, the pixel value interpolation unit 33 generates a focused image from the reference image for the focused region. The pixel value interpolation unit 33 generates a blurred image by performing the above processing for all the pixels.
  • the pixel value interpolation unit 33 corresponds to the value of the filtered parallax map of the target pixel and the value selected from the parallax map and the position of the target pixel in the selected reference blurred image.
  • the pixel value of the target pixel can be calculated by interpolation using the pixel value of the pixel. Thereby, the pixel value interpolation unit 33 can generate an appropriate blurred image corresponding to the parallax value.
  • the intervals between the step width DW1 to the step width DW3 in FIG. 10 do not have to be fixed lengths (that is, the intervals of DW are always constant), and each interval can be made variable.
  • the value of the denominator (a + b) in Expression (1) changes depending on each interval from the step width DW1 to the step width DW3.
  • the number of step widths DW (the number of types of kernel size KS) may be one or more.
  • the blurred image generation processing unit 30 performs the series of blurred image generation processes described above for each of the foreground region and the background region, and generates a blurred image in the foreground region and a blurred image in the background region.
  • the blurred image generation processing unit 30 outputs the generated data of the blurred image GP1 in the foreground region and the data of the blurred image GP2 in the background region to the image composition unit 40.
  • the image composition unit 40 uses the brightness value in the focus area of the reference image data for the pixel with the focus flag 1 input from the blur amount selection unit 23 as the brightness of the composite image. Value.
  • the image composition unit 40 sets the brightness value of the blurred image as the brightness value of the composite image for the pixel whose focus flag is 0 input from the blur amount selection unit 23. Thereby, the image composition unit 40 can blur only the out-of-focus area while keeping the pixels in the in-focus area.
  • the image composition unit 40 generates a composite image by substituting the brightness value of each area into the brightness value of the composite image in the order of the background area, the focus area, and the foreground area.
  • the image composition unit 40 outputs the generated composite image data IMGDATAOUT to the outside.
  • FIG. 11 is a flowchart showing a process flow of the image processing apparatus 10 (see FIG. 2) according to the first embodiment of the present invention.
  • the parallax map generation unit 12 generates a parallax map by block matching from the standard image and the reference image (step S101).
  • the parallax value conversion unit 21 for each area divides the reference image and the parallax map into the foreground area, the in-focus area, and the background area, and converts the parallax value by the method described above (step S102).
  • the LPF processing unit (map filter processing unit) 22 applies LPF to the converted parallax map (step S103).
  • the blur amount selection unit 23 calculates a blur amount (table) corresponding to the converted parallax value for the foreground region (step S104).
  • the blurred image generation processing unit 30 selects the corresponding kernel-size blurred image from the blur amount (table) for the foreground area, and performs the blurred image generation processing according to the converted parallax value (step S105). .
  • the blur amount selection unit 23 calculates a blur amount (table) corresponding to the converted parallax value with respect to the background region (step S106).
  • the blurred image generation processing unit 30 selects a blurred image having a kernel size corresponding to the background area from the amount of blurring (table), and performs a blurred image generation process according to the converted parallax value (step S107).
  • the blurred image generation processing unit 30 generates a focused image from the reference image for the focused area (step S108).
  • the image composition unit 40 superimposes the background region, the focus region, and the foreground region (step S109). Above, the process of the flowchart of FIG. 11 is complete
  • FIG. 12 is a flowchart showing a processing flow of the blurred image generation processing unit 30 according to the first embodiment of the present invention.
  • the reference blurred image generation unit 31 generates a blurred image with three types of kernel sizes (step S201).
  • the reference blurred image selection unit 32 selects two blurred images near the parallax value of the target pixel for each pixel (step S202).
  • the pixel value interpolation unit 33 generates a blurred image corresponding to the parallax value of the target pixel from the parallax values of the two blurred images by linear interpolation (step S203).
  • the process of the flowchart of FIG. 12 is complete
  • the image processing apparatus 10 can apply the LPF to the parallax map from the position corresponding to the edge of the subject to convert the parallax value of the expansion region so as to change gently. Thereby, the image processing apparatus 10 can change the filter size used for blurring according to the parallax value after LPF application. Due to the effect of applying the LPF from the position corresponding to the edge of the subject to the parallax map, the blur from the foreground area to the in-focus area changes gently even in the expanded parallax map, and the switching portion between the foreground and the in-focus area The boundary of can be made inconspicuous.
  • the background area image around the in-focus area can be excluded from the in-focus area, the pixel value of the in-focus component generated in the background area image at the switching portion between the in-focus area and the background area is inconspicuous. Can do.
  • the image processing apparatus 10 generates a plurality of blurred images having blur amounts corresponding to a plurality of values selected from the parallax values after applying the LPF, and pixel values of the blurred image according to the parallax values after applying the LPF.
  • a composite image can be generated by linear interpolation using. Thereby, in the foreground area and the background area, the image can be naturally blurred according to the depth.
  • FIG. 13 is a block diagram of an image processing apparatus 10b according to the second embodiment of the present invention. Elements that are the same as those in FIG. 2 are given the same reference numerals, and descriptions thereof are omitted.
  • the configuration of the image processing device 10b in FIG. 13 is obtained by adding an image reduction unit 24, a flag enlargement unit 25, and an image enlargement unit 34 to the configuration of the image processing device 10 in FIG. .
  • the configuration of the image processing apparatus 10b in FIG. 13 is changed from the configuration of the image processing apparatus 10 in FIG. 2 to the parallax map generation unit 12b in the parallax map generation unit 12b.
  • the blur coefficient calculation processing unit 20 is changed to a blur coefficient calculation processing unit 20b.
  • the blur amount selection unit 23 is changed to a blur amount selection unit 23b.
  • the blurred image generation processing unit 30 is changed to a blurred image generation processing unit 30b.
  • the image composition unit 40 is changed to an image composition unit 40b.
  • the image reduction unit 24 reduces the standard image input from the outside and the reference image at a predetermined magnification (for example, 1 ⁇ 4). Then, the image reduction unit 24 outputs the reduced standard image data and the reduced reference image data to the parallax map generation unit 12b. The image reducing unit 24 outputs the reduced reference image data to the blurred image generation processing unit 30b.
  • a predetermined magnification for example, 1 ⁇ 4
  • the parallax map generation unit 12b is configured to generate a predetermined window from the reduced standard image data input from the image reduction unit 24 and the reduced reference image data.
  • a parallax map is generated by a known block matching method using the size WW.
  • the parallax map generation unit 12 b outputs the parallax value data DisparityData forming the generated parallax map to the parallax value conversion unit 21 for each region of the blurring coefficient calculation processing unit 20.
  • the blur amount selection unit 23b calculates the blur amount and the focus flag, and outputs information indicating the focus flag to the flag enlargement unit 25, as with the blur amount selection unit 23 of the first embodiment. Further, the blur amount selection unit 23b outputs information indicating the calculated blur amount to the blur image generation processing unit 30b.
  • the flag enlarging unit 25 enlarges the blurred image by the image enlarging unit 34 (to be described later) from the information indicating the in-focus flag input from the filter size selecting unit 23b. Enlarge at the same magnification as the magnification (for example, 4 times).
  • the flag enlargement unit 25 outputs the information on the enlarged focus area to the image composition unit 40b.
  • the blurred image generation processing unit 30b is based on the input information indicating the amount of blurring and the reduced reference image data, and the foreground region and the background region. Generate a blurred image of.
  • the blurred image generation processing unit 30b outputs the generated blurred image data of the foreground region and blurred image data of the background region to the image enlargement unit 34.
  • the image enlarging unit 34 enlarges the input foreground blurred image in the foreground region by a known bilinear interpolation at a magnification (for example, 4 times) the inverse of the reduction magnification in the image reducing unit 24. Similarly, the image enlarging unit 34 enlarges the input blurred image of the background area by bilinear interpolation at a magnification (for example, 4 times) the inverse of the reduction magnification in the image reducing unit 24.
  • the interpolation is not limited to bilinear interpolation.
  • the image enlargement unit 34 outputs the enlarged blurred image data of the foreground region and the enlarged blurred image data of the background region to the image composition unit 40b.
  • the image enlargement unit 34 enlarged the blurred image at a magnification that is the inverse of the reduction magnification at the image reduction unit 24.
  • the image enlargement unit 34 is not limited to this. You may enlarge.
  • the image composition unit 40b uses the information on the enlarged focus area input from the flag enlargement unit 25 to generate a focused image from the reference image before reduction input from the outside for the enlarged focus area. . Similar to the image composition unit 40, the image composition unit 40b combines each region in the order of the background region, the focus region, and the foreground region to generate a composite image. The image composition unit 40b outputs the generated composite image data IMGDATAOUT to the outside.
  • FIG. 14 is a flowchart showing the flow of processing of the image processing apparatus 10b according to the second embodiment of the present invention.
  • the image reducing unit 24 reduces the standard image and the reference image to a predetermined magnification (for example, 1 ⁇ 4) (step S301).
  • the parallax map generation unit 12b obtains a parallax map by block matching from the reduced standard image and the reduced reference image (step S302).
  • the parallax value conversion unit 21 for each area divides the reduced reference image and parallax map into a foreground area, a focus area, and a background area (step S303).
  • the LPF processing unit (map filter processing unit) 22 applies LPF to the parallax map (step S304).
  • the blurred image generation processing unit 30b calculates a blur amount (table) corresponding to the converted parallax value for the foreground region of the reduced reference image (step S305).
  • the blurred image generation processing unit 30b selects a corresponding kernel-size blurred image from the amount of blurring (table) in the processing flow shown in FIG. A blurred image generation process is performed according to the parallax value (step S306).
  • the blurred image generation processing unit 30b calculates a blur amount (table) corresponding to the converted parallax value for the background region of the reduced reference image (step S307).
  • the blurred image generation processing unit 30b selects and converts the corresponding kernel-size blurred image from the amount of blurring (table) in the processing flow shown in FIG.
  • a blurred image generation process is performed according to the parallax value (step S308).
  • the image enlargement unit 34 enlarges the blurred image in the foreground area and the blurred image in the background area at a predetermined magnification (for example, 4 times) using bilinear interpolation.
  • the flag expanding unit 25 expands the focus flag by the nearest neighbor method (step S310).
  • the image composition unit 40b generates a focused image from the reference image before reduction using the enlarged focus flag (step S311).
  • the image composition unit 40b composes the areas in the order of the background area, the focus area, and the foreground area (step S312). Above, the process of the flowchart of FIG. 14 is complete
  • the image processing apparatus 10b reduces the depth resolution by reducing the standard image and the reference image, which are input images, and the change in the depth value in one subject is reduced. Therefore, it is possible to reduce the frequency of blurring from the middle of the subject that changes in the depth direction.
  • a computer program for executing each process of the image processing apparatus 10 (see FIG. 2) according to the first embodiment of the present invention and the image processing apparatus 10b (see FIG. 13) according to the second embodiment of the present invention is also described. You may record on a readable recording medium. Then, the above-described various processes relating to the image processing apparatus 10 and the image processing apparatus 10b may be performed by causing the computer system to read and execute the program recorded on the recording medium.
  • the “computer system” here may include an OS (Operating System) and hardware such as peripheral devices. Further, the “computer system” includes a homepage providing environment (or display environment) if a WWW (World Wide Web) system is used.
  • “Computer-readable recording medium” means a flexible disk, a magneto-optical disk, a ROM (Read Only Memory), a writable non-volatile memory such as a flash memory, a CD-ROM (Compact Disc-Read Only Memory), etc.
  • a storage device such as a portable medium or a hard disk built in a computer system.
  • the “computer-readable recording medium” means a volatile memory (for example, DRAM (Dynamic DRAM) in a computer system that becomes a server or a client when a program is transmitted through a network such as the Internet or a communication line such as a telephone line. Random Access Memory)), etc. that hold programs for a certain period of time.
  • the program may be transmitted from a computer system storing the program in a storage device or the like to another computer system via a transmission medium or by a transmission wave in the transmission medium.
  • the “transmission medium” for transmitting the program refers to a medium having a function of transmitting information, such as a network (communication network) such as the Internet or a communication line (communication line) such as a telephone line.
  • the program may be for realizing a part of the functions described above. Furthermore, what can implement
  • the present invention can be applied to an image processing apparatus, an image processing method, an image processing program, and the like that generate an image that is gently blurred in the boundary region between the subject and the background or the foreground.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Architecture (AREA)
  • Computer Graphics (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Image Processing (AREA)
  • Testing, Inspecting, Measuring Of Stereoscopic Televisions And Televisions (AREA)

Abstract

 画像処理装置は、画像の各画素についての視差値に基づく視差マップにフィルタをかけるマップ用フィルタ処理部と、前記画像から前記画像のぼかし画像を生成するぼかし画像生成部と、前記マップ用フィルタ処理部によるフィルタ後の視差マップに基づいて、前記画像と前記ぼかし画像とを合成した合成画像を生成する画像合成部とを備える。

Description

画像処理装置、画像処理方法及び画像処理プログラム
 本発明は、画像処理装置、画像処理方法及び画像処理プログラムに関する。
 本願は、2010年12月3日に、日本に出願された特願2010-270735号に基づき優先権を主張し、その内容をここに援用する。
 画像生成装置は、奥行きのある画像を生成する際に、画像の奥行き方向に関して、カメラの焦点領域にあるオブジェクトについては、輪郭が明確な画像であって、カメラの焦点領域から外れたオブジェクトについては輪郭がぼやけた画像を生成する。これにより、画像生成装置は、遠近感を現実世界に近い形で表現した画像を生成する。
 特許文献1には、物体輪郭線において不連続に変化する視差を推定する視差推定方法が記載されている。この視差推定方法は、2つの画像の初期視差と、初期視差の信頼性評価値とを計算し、初期視差の信頼性の低い領域における視差を周囲の視差に対して滑らかに接続するように設定し、かつ物体輪郭線においては変化するように決定する。
 特許文献2には、現実世界の視界画像のようにフォーカシングされた画像を生成する画像生成システムが記載されている。この画像生成システムは、元画像の各画素の奥行き値に応じたα値を設定し、元画像と、その元画像に対応するぼかし画像とを、各画素に設定されるα値に基づいて合成することにより、フォーカシングされた画像を生成する。
 また、特許文献3には、視点からの距離に応じてフォーカシングされた画像を生成する画像処理プログラムが記載されている。この画像処理プログラムは、基準画像の各画素の奥行き値に応じて各画素のα値を設定する設定ステップと、隣接する2つの画素のうちでα値が小さいほうの画素に設定されたα値を増加させる増加ステップとを有する。そして、この画像処理プログラムは、基準画像と、その基準画像に対応するぼかし画像とを、増加ステップによる処理後の各画素に設定されるα値に基づいて合成することにより、フォーカシングされた画像を生成する。
特開2004-7707号公報 特開2001-175884号公報 特開2008-225767号公報
 特許文献1のように視差を推定する場合、画像の各画素における視差値を画像として表示した視差マップでは、被写体の大きさより大きい膨張した視差マップが生成される。ここで、視差値とは、2地点での観測地点の位置で撮像された画像において、画像に撮像された対象点が2つの画像において水平方向に離れている画素数である。
 被写体の大きさより大きい膨張した視差マップが生成されることにより、従来の画像生成装置が基準画像とぼかし画像とを合成した合成画像を生成した場合、その合成画像では、被写体と背景との境界付近の背景画像がくっきりしてしまう。すなわち、従来の画像生成装置には、被写体と背景との境界領域で、不自然なぼけ方をするという問題があった。この問題は、特許文献2および特許文献3に記載の画像生成システムまたは画像処理プログラムにおいても解決されていなかった。
 そこで本発明は、上記問題に鑑みてなされたものであり、被写体と、背景または前景との境界領域で、自然なぼけとなる画像を生成することを可能とする画像処理装置、画像処理方法及び画像処理プログラムを提供することを課題とする。
(1) 上記の課題を解決するために、本発明の一態様である画像処理装置は、画像の各画素についての視差値に基づく視差マップにフィルタをかけるマップ用フィルタ処理部と、前記画像から前記画像のぼかし画像を生成するぼかし画像生成部と、前記マップ用フィルタ処理部によるフィルタ後の視差マップに基づいて、前記画像と前記ぼかし画像とを合成した合成画像を生成する画像合成部と、を備える。
(2) 上記画像処理装置は、前記マップ用フィルタ処理部によりフィルタがかけられた視差マップに応じて画像用フィルタのサイズを選択するフィルタサイズ選択部を備えてもよく、前記ぼかし画像生成部は、前記画像に前記画像用フィルタをかけることにより、前記ぼかし画像を生成してもよい。
(3) 上記画像処理装置は、前記画像を前記視差値に応じて所定の領域に分割し、前記領域毎に視差値を変換する領域分割部を備えてもよく、前記マップ用フィルタ処理部は、前記領域分割部により視差値が変換された視差マップにフィルタをかけてもよい。
(4) 上記画像処理装置は、前記画像のサイズを縮小する画像縮小部を備えてもよく、前記ぼかし画像生成部は、前記画像縮小部により縮小された画像のぼかし画像を生成してもよく、前記縮小された画像のぼかし画像を所定のサイズに拡大する画像拡大部を備えてもよい。
(5) 上記画像処理装置において、前記ぼかし画像生成部は、視差マップから複数の値を選択し、前記選択した複数の値のそれぞれに応じたぼかし量を持つ基準ぼかし画像を生成する基準ぼかし画像生成部と、前記画像の注目画素毎に、前記注目画素の前記フィルタ後の視差マップの値と前記選択した値との比較に基づいて、前記基準ぼかし画像から基準ぼかし画像を選択する基準ぼかし画像選択部と、前記選択された基準ぼかし画像のうち前記注目画素の位置に相当する画素の画素値と前記注目画素のフィルタ後の視差マップの値と前記選択した値とに基づいて、前記注目画素の画素値を算出する画素値補間部と、を備えてもよい。
(6) 上記画像処理装置において、前記画素値補間部は、前記注目画素のフィルタ後の視差マップの値と前記選択した値とに基づく値と、前記選択された基準ぼかし画像のうち前記注目画素の位置に相当する画素の画素値とを用いた補間によって、前記注目画素の画素値を算出してもよい。
(7) また、本発明の一態様である画像処理方法は、画像の各画素についての視差値に基づく視差マップにフィルタをかけ、前記画像から前記画像のぼかし画像を生成し、フィルタをかけた後の視差マップに基づいて、前記画像と前記ぼかし画像とを合成した合成画像を生成する。
(8) また、本発明の一態様である画像処理プログラムは、画像処理装置のコンピュータに、画像の各画素についての視差値に基づく視差マップにフィルタをかけさせ、前記画像から前記画像のぼかし画像を生成させ、フィルタをかけた後の視差マップに基づいて、前記画像と前記ぼかし画像とを合成した合成画像を生成させる。
 本発明によれば、被写体と、背景または前景との境界領域において、自然なぼけとなる画像を生成することができる。
本発明の各実施形態における画像処理装置による処理の概要を示した図である。 本発明の第1の実施形態における画像処理装置のブロック構成図である。 ぼかし係数算出処理部の処理の詳細を説明するための図である。 LPFのカーネルサイズの横幅が、視差マップ生成時のウインドウサイズの横幅より大きい場合の、LPF適用後の視差値を示した図である。 LPFのカーネルサイズの横幅が、視差マップ生成時のウインドウサイズの横幅の半分である場合の、LPF適用後の視差値を示した図である。 LPFのカーネルサイズの横幅が、視差マップ生成時のウインドウサイズの横幅である場合の、LPF適用後の視差値を示した図である。 元の視差値の一例を示した図である。 領域分割による変換後の視差値の一例を示した図である。 LPF適用後の平滑化された視差値の一例を示した図である。 弱いぼかし量の画像を生成する際に用いられるカーネルの一例を示した図である。 中くらいのぼかし量の画像を生成する際に用いられるカーネルの一例を示した図である。 強いぼかし量の画像を生成する際に用いられるカーネルの一例を示した図である。 ぼかし画像生成処理部のブロック構成図である。 ぼかし画像の各画素の画素値を線形補間により算出する方法を説明するための図である。 本発明の第1の実施形態における画像処理装置の処理の流れを示したフローチャートである。 本発明の第1の実施形態におけるぼかし画像生成処理部30の処理の流れを示したフローチャートである。 本発明の第2の実施形態における画像処理装置のブロック構成図である。 本発明の第2の実施形態における画像処理装置の処理の流れを示したフローチャートである。
 図1は、本発明の各実施形態における画像処理装置による処理の概要を示した図である。
 入力画像1は、一例として、全面の背景領域の中央に、合焦した(撮像機の焦点の合った)平屋の民家100(被写体)が存在する画像である。視差マップ2は、入力画像1の合焦した民家100のエッジ101から背景領域へと遠ざかるに従って背景領域の視差の変化をなだらかにした画像である。具体的には、視差マップ2は、被写体である民家100の画像に、LPF(Low Pass Filter)をかけ、被写体100のエッジ101と背景領域の視差の変化をなだらかにすることにより得られる。
 背景ぼかし画像3は、入力画像1と視差マップ2とを用いて背景についてぼかし処理をした背景ぼかし画像を抜き出した画像である。被写体4は、入力画像1と視差マップ2とを用いて合焦領域にある被写体(民家100)を抜き出した画像である。
 出力画像5は、背景ぼかし画像3と、合焦領域にある被写体4の画像とを合成した画像である。この出力画像5は、被写体エッジ101と、背景領域の境界領域とが、なだらかに(自然に)ぼけるようにされている。
 <第1の実施形態>
 図2は、本発明の第1の実施形態における画像処理装置10の構成を示す概略ブロック図である。
 画像処理装置10は、記憶部11と、視差マップ生成部12と、ぼかし係数算出処理部20と、ぼかし画像生成処理部30と、画像合成部40とを備える。ぼかし係数算出処理部20は、さらに、領域毎の視差値変換部(領域分割部)21と、LPF処理部(「フィルタ処理部」と言うことがある。)22と、ぼかし量選択部(フィルタサイズ選択部)23とを備える。
 記憶部11には、外部から入力された前景境界の合焦視差値FFを示す情報と、背景境界の合焦視差値FRを示す情報と、視差値を区画に分割するときの分割幅であるステップ幅DWを示す情報と、LPFのカーネルサイズWWを示す情報と、複数の基準ぼかし画像を生成する際に用いるカーネルのサイズである複数のカーネルサイズKSを示す情報と、前記複数のカーネルサイズKSそれぞれに対応するぼかし係数GCを示す情報とが記憶されている。
 ここで、LPFのカーネルサイズWWは、視差マップ生成時のウインドウサイズである。複数のカーネルサイズKSのうちの1つは、LPFのカーネルサイズWWと同じ値であっても良い。また、記憶部11に記憶されているカーネルサイズKSの数は、生成するぼかし画像の数と同数である。
 視差マップ生成部12は、外部から入力された基準画像のデータIMGDATAと、参照画像のデータREFDATAとから、所定のウインドウサイズ(例えば、LPFのカーネルサイズWWと同じサイズ)を用いた公知のブロックマッチング法により、各画像の画素の位置に対応した視差値を有する視差マップを生成する。視差マップ生成部12は、生成した視差マップを形成する視差値データDisparityDataを、ぼかし係数算出処理部20の後述する領域毎の視差値変換部21に出力する。
 ぼかし係数算出処理部20は、視差マップ生成部12から入力された視差マップを形成する視差値データDisparityDataに基づいて、ぼかし量GA(ぼかす度合い)を算出する。そして、ぼかし係数算出処理部20は、算出したぼかし量GAを示す情報と、視差値d’’とを、ぼかし画像生成処理部30に出力する。
 ぼかし画像生成処理部30は、入力されたぼかし量GAを示す情報と、基準画像のデータIMGDATAとに基づいて、前景領域および背景領域のぼかし画像GPを生成する。
 図3は、ぼかし係数算出処理部20の処理の詳細を説明するための図である。
 領域毎の視差値変換部21は、前景境界の合焦視差値FFを示す情報と、背景境界の合焦視差値FRを示す情報とを記憶部11から読み出す。
 領域毎の視差値変換部21は、外部から入力された視差値データDisparityDataの値dが、背景境界の合焦視差値FRより小さい場合、すなわち背景領域である場合、変換後の視差値データd’をFR-dとする。
 一方、視差値データDisparityDataの値dが、前景境界の合焦視差値FFより大きい場合、すなわち前景領域である場合、領域毎の視差値変換部21は、変換後の視差値データd’をd-FFとする。
 また、視差値データDisparityDataの値dが、背景境界の合焦視差値FR以上であって、前景境界の合焦視差値FF以下の場合、すなわち合焦領域である場合、領域毎の視差値変換部21は、変換後の視差値データd’を0とする。
 すなわち、領域毎の視差値変換部21は、画像の各画素の視差値を保持する視差マップを、その視差値に応じて所定の領域に分割し、その領域に応じて視差値を変換する。
 そして、領域毎の視差値変換部21は、変換後の視差値データd’をLPF処理部(マップ用フィルタ処理部)22に出力する。
 LPF処理部(マップ用フィルタ処理部)22は、カーネルサイズWWを示す情報と、そのぼかし係数GCを示す情報とを、記憶部11から読み出す。LPF処理部(マップ用フィルタ処理部)22は、変換後の視差値データd’から成る視差マップに、読み出したカーネルサイズWWと、そのぼかし係数GCとでLPFをかける。これにより、LPF処理部(マップ用フィルタ処理部)22は、前景領域と背景領域と合焦領域との間を、視差値が急激に変化しないように平滑化する。
 続いて、図2のLPF処理部(マップ用フィルタ処理部)22で用いるカーネルサイズWWについて説明する。
 図4A~図4Cは、LPF処理部(マップ用フィルタ処理部)22で用いるカーネルサイズWWについて説明するための図である。
 図4Aは、LPFのカーネルサイズの横幅411及び412が、視差マップ生成時のウインドウサイズの横幅より大きい場合の、LPF適用後の視差値を示した図である。なお、図4Aにおいて、符号413は、被写体のエッジを示している。また、符号414は、LPF適用後の視差値を示している。また、符号415は、背景を示している。また、符号416は、ウィンドウサイズの半値幅分の膨張領域を示している。
 図4Aには、画像の横方向の座標(以下、画像横座標と称する)に対して、LPF適用前の視差値と、LPF適用後の視差値とが示されている。
 図4Aにおいて、丸417で囲って示したLPF適用後の視差値は、合焦領域であるにも関わらず背景領域としてLPFがかけられてしまう。そのため、丸417で示されたLPF適用後の視差値に対応する合成画像の合焦領域の一部が、ぼけるという問題がある。
 図4Bは、LPFのカーネルサイズの横幅421及び422が、視差マップ生成時のウインドウサイズの横幅の半分である場合の、LPF適用後の視差値を示した図である。なお、図4Bにおいて、符号423は、被写体のエッジを示している。また、符号424は、LPF適用後の視差値を示している。また、符号425は、背景を示している。また、符号426は、ウィンドウサイズの半値幅分の膨張領域を示している。
 図4Bには、画像横座標に対して、LPF適用前の視差値とLPF適用後の視差値が示されている。
 図4Bにおいて、丸427で囲って示したLPF適用後の視差値は、背景領域であるにも関わらず合焦領域としてLPFがかけられていない。そのため、丸427で示されたLPF適用後の視差値に対応する合成画像の背景領域の一部がぼけないという問題がある。
 図4Cは、LPFのカーネルサイズの横幅431及び432が、視差マップ生成時のウインドウサイズの横幅である場合の、LPF適用後の視差値を示した図である。なお、図4Cにおいて、符号433は、被写体のエッジを示している。また、符号434は、LPF適用後の視差値を示している。また、符号435は、背景を示している。また、符号436は、ウィンドウサイズの半値幅分の膨張領域を示している。
 図4Cには、画像の横方向の座標(以下、画像横座標と称する)に対して、LPF適用前の視差値と、LPF適用後の視差値とが示されている。
 図4Cにおいて、合焦領域に対してLPFがかけられてしまうことがなく、最終的な合成画像の合焦領域の一部がぼけるという問題が生じない。また、変換後の視差値に対して被写体のエッジから背景にかけてLPFを掛けることができる。そのため、最終的な合成画像の被写体のエッジから背景にかけてぼけさせることができる。
 また、LPF適用後の視差値が被写体エッジから背景に向かってなだらかに変化するので、合成画像の背景領域におけるぼけ方がなだらかに変化する。
 従って、LPF処理部(マップ用フィルタ処理部)22は、視差マップ生成時のウインドウサイズと同じカーネルサイズWWで視差マップに対しLPFをかけ、LPF適用後の視差値d’’を算出する。LPF処理部(マップ用フィルタ処理部)22は、LPF適用後の視差値d’’を示す情報を、ぼかし量選択部23に出力する。
 図5A~図5Cは、元の視差値d(図5A)と、領域毎の視差値変換による変換後の視差値d’(図5B)と、LPF適用後の視差値d’’(図5C)の一例を示した図である。
 図5Aには、画像横座標に対する元の視差値の関係の一例が示されている。
 図5Aにおいて、横軸は画像横座標であり、縦軸は視差値dである。この例では、画像横座標において、向かって左側(原点に近い方)が前景領域であり、真ん中が合焦領域であり、右側(原点から遠い方)が背景領域である。上記3つの領域の中で、前景領域の視差値が高く、合焦領域の視差値が中くらいであり、背景領域の視差値が低くなっている。
 図5Bには、画像横座標に対する領域毎の視差値変換部21による領域毎の視差値変換による変換後の視差値の一例が示されている。図5Bは、図5Aに対して、領域毎の視差値変換を行った場合を示している。図5Bにおいて、横軸は画像横座標であり、縦軸は変換後の視差値d’である。この例では、画像横座標において、向かって左側が前景領域であり、真ん中が合焦領域であり、右側が背景領域である。前景領域および背景領域の変換後の視差値d’は正の値を取るのに対し、合焦領域では0を取ることが示されている。ここで、前景領域と合焦領域の境界または合焦領域と背景領域との境界において、変換後の視差値d’が画像横座標に対して急激に変化している。
 図5Cには、本実施形態に従って、画像横座標に対するLPF処理部22によるLPF適用後の視差値の一例が示されている。図5Cにおいて、横軸は画像横座標であり、縦軸はLPF適用後の視差値d’’である。この例では、画像横座標において、向かって左側が前景領域であり、真ん中が合焦領域であり、右側が背景領域である。ここで、前景領域と合焦領域の境界または合焦領域と背景領域との境界において、LPF適用後の視差値d’’が画像横座標に対してなだらかに変化している。図5Cは、図5Bに対して、LPF処理を行った場合を示している。
 以上のように、LPF処理部(マップ用フィルタ処理部)22は、視差マップに対しLPFをかける。これにより、前景領域と合焦領域の境界、または、合焦領域と背景領域との境界において、画像横座標に対してLPF適用後の視差値d’’の変化をなだらかにすることができる。
 また、画像処理装置10では、領域毎の視差値変換部21が、基準画像を前景領域と背景領域と合焦領域とに領域分割し、視差値を変換した後に、LPF処理部(マップ用フィルタ処理部)22がLPFの処理を行う。これにより、合成画像中の合焦領域と背景領域の接する近傍において、背景領域側に合焦領域のエッジ近傍画像による輪郭の発生を防ぐことができる。
 図5Aのように前景、合焦、背景と順に変化する場合には、合成画像中で前景と背景との間に、合焦領域の画像が現われる。そのため、もし、画像処理装置10が領域毎の視差値変換をせずに(入力視差マップのままで)LPF処理をしても視差値が0になることはない。
 しかし、合成画像中で前景領域と背景領域とが重なっている場合、すなわち前景領域の次に背景領域となり、合焦領域がない場合には、同様に画像処理装置が領域毎の視差値変換をせずに入力視差マップのままでLPF処理をすると、視差値が0となる。そのため、本来、合成画像中に合焦領域が存在しないところに、合焦した画像が現われるという問題がある。
 領域毎の視差値変換部21が、領域毎の視差値変換を行うことによって、変換後の前景および背景の視差値は、合焦領域の視差値を含まないため、その変換後の視差値が0となることはない。従って、合成画像中で、前景領域と背景領域とが重なっている場合において、画像処理装置10が、領域毎の視差値変換を行った後にLPF処理をすると、視差値が0となる領域は生成されない。
 本実施形態では、領域毎の視差値変換部21が、領域毎の視差値変換を行った後に、LPF処理部22がLPF処理をする。これにより、合成画像中の前景領域から背景領域に変化する領域において、合焦した画像が現われるのを防ぐことができる。
 なお、LPF処理部(マップ用フィルタ処理部)22は、視差マップにフィルタを掛ける際に、図6から図8に示すようなテーブルT1~T3の中心から端に行くに従って要素の値が小さくなるカーネルを用いても良い。なお、これに限らず、カーネルの要素すべてが同じカーネルを用いてもよい。例えば、カーネルが3×3の場合、全ての要素が1/9であってもよい。
 また、LPF処理部(マップ用フィルタ処理部)22は、LPF適用後の視差値が図4Cに示すように、被写体のエッジに相当する位置から視差値がなだらかに変化するようにフィルタしたが、これに限られるものではない。例えば、LPF適用後の視差値が、図4Aに示すように被写体のエッジよりも被写体内部に入り込んだ画素に相当する位置から視差値がなだらかに変化するようにフィルタしてもよい。この場合、被写体内部に入り込んだ画素から、画像がぼけ始めることとなる。
 図3の説明に戻り、ぼかし量選択部23は、記憶部11からステップ幅DWを示す情報と、複数のカーネルサイズKSを示す情報とを読み出す。ぼかし量選択部23は、カーネルサイズKSの種類の数と同じ数だけ、ステップ幅DW毎に閾値を設定する。例えば、ぼかし量選択部23は、カーネルサイズKSの種類の数が3なので、DWと、DW×2と、DW×3とを閾値として設定する。
 ぼかし量選択部23は、LPF適用後の視差値d’’が0の場合、すなわち合焦領域の場合、画像に対しLPFをかける際のカーネルの情報を保持するテーブルを識別するぼかし量テーブルを0とし、合焦フラグFAを立てる。
 一方、ぼかし量選択部23は、LPF適用後の視差値d’’がステップ幅DWより小さい場合、すなわち弱いぼかし量の場合、ぼかし量テーブルを1とし、合焦フラグを立てない。
 上記以外の場合において、ぼかし量選択23は、LPF適用後の視差値d’’がステップ幅DWの2倍より小さい場合、すなわち中くらいのぼかし量の場合、ぼかし量テーブルを2とし、合焦フラグを立てない。
 上記以外の場合において、ぼかし量選択23は、LPF適用後の視差値d’’がステップ幅DWの3倍より小さい場合、すなわち強いぼかし量の場合、ぼかし量テーブルを3とし、合焦フラグを立てない。
 上記以外の場合、すなわちLPF適用後の視差値d’’がステップ幅DWの3倍を超える場合、ぼかし量選択23は、ぼかし量テーブルを4とし、合焦フラグを立てない。
 ぼかし量選択部23は、合焦フラグを示す情報を画像合成部40に出力し、ぼかし量テーブルGTを示す情報とLPF適用後の視差値d’’を示す情報とをぼかし画像生成処理部30に出力する。
 なお、図3で示されたステップ幅DW1からDW3の各間隔は、固定長(ステップ幅DWの間隔が常に一定)である必要はなく、可変にしてもよい。
 図2の説明に戻り、ぼかし画像生成処理部30は、ぼかし量選択部23から入力されたぼかし量を示す情報と、外部から入力された基準画像のデータIMGDATAとに基づいて、ぼかし画像を生成する。そして、ぼかし画像生成処理部30は、ぼかし画像GPを示す情報を、画像合成部40に出力する。
 図9は、ぼかし画像生成処理部30(図2参照)のブロック構成図である。ぼかし画像生成処理部30は、基準ぼかし画像生成部31と、基準ぼかし画像選択部32と、画素値補間部33とを備える。
 基準ぼかし画像生成部31が生成する基準ぼかし画像の数は、カーネルサイズKSの種類の数である。ここでは、例としてカーネルサイズKSの種類の数が3の場合について説明する。なお、カーネルサイズKSの種類の数は、1つ以上あればよい。基準ぼかし画像生成部31が生成する基準ぼかし画像の数が、多ければ多いほど、ぼけ画像の各画素値を基準ぼかし画像から正確に補間できる。そのため、画像処理装置10は、被写体との距離に応じた滑らかなぼけ画像が生成できる。
 基準ぼかし画像生成部31は、3つの異なるカーネルサイズをもつカーネルのぼかし係数GCそれぞれと、外部から供給された基準画像のデータIMGDATAとを畳み込むことにより、3種類の基準ぼかし画像を生成する。
 具体的には、基準ぼかし画像生成部31は、図6に示されたテーブルT1(3×3)のカーネルと、基準画像のデータIMGDATAとを畳み込むことにより、第1の基準ぼかし画像(弱ぼけ画像)を生成する。基準ぼかし画像生成部31は、図7に示されたテーブルT2(7×7)のカーネルと、基準画像のデータIMGDATAとを畳み込むことにより、第2の基準ぼかし画像(中ぼけ画像)を生成する。基準ぼかし画像生成部31は、図8に示されたテーブルT3(15×15)のカーネルと、基準画像のデータIMGDATAとを畳み込むことにより、第3の基準ぼかし画像(強ぼけ画像)を生成する。
 ここで、それぞれのぼかし画像に対応したカーネルのぼかし係数について説明する。図6は、弱いぼかし量の画像を生成する際に用いられるカーネルのぼかし係数の一例を示した図である。図6において、図3のステップ幅DW1に対応するぼかし画像(弱ぼけ)の生成に用いるカーネルのぼかし係数の例として、3×3のテーブルT1が示されている。テーブルT1では、全要素の中で中心の要素が0.3446で一番大きく、4隅の要素が0.0386で一番小さくなっている。
 図7は、中位のぼかし量の画像を生成する際に用いられるカーネルのぼかし係数の一例を示した図である。
 図7において、図3のステップ幅DW2に対応するぼかし画像(中ぼけ)生成に用いるカーネルのぼかし係数の例として、7×7のテーブルT2が示されている。テーブルT2では、全要素の中で中心の要素が0.0324で一番大きく、端にいくほど要素が小さくなり、4隅の要素が0.0103で一番小さくなっている。
 図8は、強いぼかし量の画像を生成する際に用いられるカーネルのぼかし係数の一例を示した図である。
 図8において、図3のステップ幅DW3に対応するぼかし画像(強ぼけ)生成に用いるカーネルのぼかし係数の例として、15×15のテーブルT3が示されている。テーブルT3では、テーブルT2と同様に、全要素の中で中心の要素が0.006741で一番大きく、端にいくほど要素が小さくなり、4隅の要素が0.002038で一番小さくなっている。
 一般的に、カーネルの大きさ(ここでいうテーブルのサイズ)が大きくなるほど、そのカーネルを用いてフィルタを掛けた後の画像のぼけが大きくなる。
 例えば、ここでは、テーブルT2のサイズが、テーブルT1より大きい。そのため、テーブルT2で示されたカーネルと画像とを畳み込むことにより生成される画像のぼかし量は、テーブルT1で示されたカーネルと画像とを畳み込むことにより生成される画像のぼかし量より大きい。
 また、ここでは、テーブルT3のサイズが、テーブルT2より大きい。そのため、テーブルT3で示されたカーネルと画像とを畳み込むことにより生成される画像のぼかし量は、テーブルT2で示されたカーネルと画像とを畳み込むことにより生成される画像のぼかし量より大きい。
 図9の説明に戻り、基準ぼかし画像生成部31は、生成した3種類の基準ぼかし画像SGを示す情報を、基準ぼかし画像選択部32へ出力する。
 基準ぼかし画像選択部32は、ぼかし量選択部23から入力されたぼかし量を示す情報を用いて、ぼかし画像の画素毎に、注目画素の視差値近傍のぼかし画像を2つ選択する。
 例えば、ぼかし量が1の場合、基準ぼかし画像選択部32は、基準画像と弱ぼけ画像とを選択する。ぼかし量が2の場合、基準ぼかし画像選択部32は、弱ぼけ画像と、中ぼけ画像とを選択する。ぼかし量が3の場合、基準ぼかし画像選択部32は、中ぼけ画像と、強ぼけ画像とを選択する。ぼかし量が4の場合は、基準ぼかし画像選択部32は、強ぼけ画像のみを選択し、画素値補間部33で補間せずに、強ぼけ画像を示す情報をそのまま画像合成部40に出力する。
 そして、選択後に基準ぼかし画像選択部32は、どのぼかし画像を選択したかを示す選択情報を、画素値補間部33に出力する。
 画素値補間部33は、基準ぼかし画像選択部32から入力されたぼかし画像のうち、どのぼかし画像を選択したかを示す選択情報から、その選択された2つのぼかし画像の視差値d’’と、ステップ幅DWを示す情報とを読み出す。そして、画素値補間部33は、読み出した視差値d’’に基づいて、注目画素の視差値の対応するぼけ画像の画素値を線形補間により算出する。
 更に、図10を用いて、画素値補間部33の処理の詳細を説明する。図10は、ぼかし画像の各画素の画素値を、線形補間により算出する方法を説明するための図である。
 図10において、上段の横軸に、これから生成するぼかし画像の画素値(ぼかし画像データ)が示され、下段の横軸にLPF適用後の視差値d’’が示されている。
 LPF適用後の視差値d’’の1つである入力視差値d’’INが、ステップ幅DW1とステップ幅DW2との間にあるときには、その入力視差値d’’INとステップ幅DW1との差であるa(=d’’IN-DW1)と、その入力視差値d’’INとステップ幅DW2との差であるb(=DW2-d’’IN)とを算出する。
 弱ぼけの輝度値をYとし、中ぼけの輝度値をYとすると、ぼかし画像の輝度値(補間データ)Yは、以下の式(1)で算出される。
 Y=(Y×b+Y×a)/(a+b)   (1)
 画素値補間部33は、式(1)を用いて、RGB(Red、Green、Blue)のそれぞれの輝度値について、ぼかし画像の輝度値(補間データ)を算出する。また、画素値補間部33は、合焦領域に対し、基準画像から合焦画像を生成する。
 画素値補間部33は、上記の処理を全ての画素について行うことにより、ぼかし画像を生成する。
 これによれば、画素値補間部33は、注目画素のフィルタ後の視差マップの値と視差マップから選択した値とに基づく値と、選択された基準ぼかし画像のうち注目画素の位置に相当する画素の画素値とを用いた補間によって、注目画素の画素値を算出することができる。これにより、画素値補間部33は、視差値に応じた適切なぼけ画像を生成することができる。
 なお、前述したように、図10のステップ幅DW1からステップ幅DW3の各間隔は、固定長(すなわち、DWの間隔が常に一定)である必要はなく、各間隔は可変にすることができる。また、各間隔を可変にした場合、式(1)の分母(a+b)の値が、ステップ幅DW1からステップ幅DW3の各間隔によって変わることとなる。
 さらに、基準ぼかし画像生成部31の説明で述べたように、ステップ幅DWの個数(カーネルサイズKSの種類の数)も1つ以上あればよい。ステップ幅DWの個数が多ければ多いほど、ぼけ画像の各画素値を基準ぼかし画像から正確に補間できるので、画像処理装置10は、被写体との距離に応じた滑らかなぼけ画像が生成できる。
 ぼかし画像生成処理部30は、上述した一連のぼかし画像生成処理を、前景領域と背景領域のそれぞれに対して行い、前景領域のぼかし画像と背景領域のぼかし画像を生成する。
 ぼかし画像生成処理部30は、生成した前景領域のぼかし画像GP1のデータと、背景領域のぼかし画像GP2のデータとを、画像合成部40に出力する。
 図2の説明に戻り、画像合成部40は、ぼかし量選択部23から入力された合焦フラグが1の画素に対しては、基準画像のデータの合焦領域における輝度値を合成画像の輝度値とする。
 一方、画像合成部40は、ぼかし量選択部23から入力された合焦フラグが0の画素に対しては、ぼかし画像の輝度値を合成画像の輝度値とする。これにより、画像合成部40は、合焦領域の画素はそのままで、非合焦領域のみぼかすことができる。
 画像合成部40は、背景領域、合焦領域、前景領域の順に各領域の輝度値を合成画像の輝度値に代入することにより、合成画像を生成する。画像合成部40は、生成した合成画像データIMGDATAOUTを外部に出力する。
 図11は、本発明の第1の実施形態における画像処理装置10(図2参照)の処理の流れを示したフローチャートである。
 まず、視差マップ生成部12は、基準画像および参照画像からブロックマッチングにより視差マップを生成する(ステップS101)。
 次に、領域毎の視差値変換部21は、基準画像および視差マップを前景領域・合焦領域・背景領域に分割し、前述の方法で視差値を変換する(ステップS102)。
 次に、LPF処理部(マップ用フィルタ処理部)22は、変換した視差マップにLPFをかける(ステップS103)。
 次に、ぼかし量選択部23は、前景領域に対し、変換した視差値に対応するぼかし量(テーブル)を算出する(ステップS104)。
 次に、ぼかし画像生成処理部30は、前景領域に対し、ぼかし量(テーブル)から対応するカーネルサイズのぼかし画像を選択し、変換した視差値に応じたぼかし画像生成処理を行う(ステップS105)。
 次に、ぼかし量選択部23は、背景領域に対し、変換した視差値に対応するぼかし量(テーブル)を算出する(ステップS106)。
 次に、ぼかし画像生成処理部30は、背景領域に対し、ぼかし量(テーブル)から対応するカーネルサイズのぼかし画像を選択し、変換した視差値に応じたぼかし画像生成処理を行う(ステップS107)。
 次に、ぼかし画像生成処理部30は、合焦領域に対し、基準画像から合焦画像を生成する(ステップS108)。
 次に、画像合成部40は、背景領域、合焦領域、前景領域の各領域を重ね合わせて合成する(ステップS109)。
 以上で、図11のフローチャートの処理を終了する。
 続いて、図11のステップS105とステップS107のぼかし画像生成処理部30によるぼかし画像生成処理の詳細について、図12を用いて説明する。
 図12は、本発明の第1の実施形態におけるぼかし画像生成処理部30の処理の流れを示したフローチャートである。
 まず、基準ぼかし画像生成部31は、3種類のカーネルサイズでぼかし画像を生成する(ステップS201)。
 次に、基準ぼかし画像選択部32は、画素毎に、注目画素の視差値近傍のぼかし画像を2つ選択する(ステップS202)。
 次に、画素値補間部33は、2つのぼかし画像の視差値から注目画素の視差値に対応するぼけ画像を線形補間により生成する(ステップS203)。
 以上で、図12のフローチャートの処理を終了する。
 以上により、画像処理装置10は、視差マップに被写体のエッジに相当する位置からLPFをかけ、膨張領域の視差値をなだらかに変化するよう変換することができる。これにより、画像処理装置10は、LPF適用後の視差値に応じて、ぼかしに使用するフィルタサイズを変更することができる。
 視差マップに被写体のエッジに相当する位置からLPFをかけた作用により、膨張した視差マップであっても、前景領域から合焦領域までのぼけがなだらかに変化し、前景と合焦領域の切り替わり部分の境界を目立たなくすることできる。
 また、合焦領域周辺の背景領域画像が合焦領域に含まれないこととすることができるので、合焦と背景領域の切り替わり部分で背景領域画像に発生する合焦成分の画素値が目立たなくすることできる。
 また、画像処理装置10は、LPF適用後の視差値から選択した複数の値に応じたぼかし量を持つ複数のぼけ画像を生成し、LPF適用後の視差値に応じて、ぼけ画像の画素値を用いた線形補間により合成画像を生成することができる。これにより、前景領域および背景領域において、奥行に応じて画像のぼけを自然なぼけ方とすることができる。
 <第2の実施形態>
 続いて、本発明の第2の実施形態について説明する。図13は、本発明の第2の実施形態における画像処理装置10bのブロック構成図である。なお、図2と共通する要素には同一の符号を付し、その説明を省略する。
 図13の画像処理装置10bの構成は、図2の画像処理装置10の構成に対して、画像縮小部24と、フラグ拡大部25と、画像拡大部34とが追加されたものになっている。
 また、図13の画像処理装置10bの構成は、図2の画像処理装置10の構成に対して、視差マップ生成部12が、視差マップ生成部12bに変更されている。また、ぼかし係数算出処理部20が、ぼかし係数算出処理部20bに変更されている。また、ぼかし量選択部23が、ぼかし量選択部23bに変更されている。また、ぼかし画像生成処理部30が、ぼかし画像生成処理部30bに変更されている。また、画像合成部40が、画像合成部40bに変更されている。
 画像縮小部24は、外部から入力された基準画像と、参照画像とを、所定の倍率(例えば、4分の1)で縮小する。そして、画像縮小部24は、縮小した基準画像のデータと、縮小した参照画像のデータとを、視差マップ生成部12bに出力する。また、画像縮小部24は、縮小した基準画像のデータを、ぼかし画像生成処理部30bに出力する。
 視差マップ生成部12bは、第1の実施形態の視差マップ生成部12と同様に、画像縮小部24から入力された縮小した基準画像のデータと、縮小した参照画像のデータとから、所定のウインドウサイズWWを用いた公知のブロックマッチング法により、視差マップを生成する。視差マップ生成部12bは、生成した視差マップを形成する視差値データDisparityDataを、ぼかし係数算出処理部20の領域毎の視差値変換部21に出力する。
 ぼかし量選択部23bは、第1の実施形態のぼかし量選択部23と同様に、ぼかし量と合焦フラグとを算出し、合焦フラグを示す情報をフラグ拡大部25に出力する。また、ぼかし量選択部23bは、算出したぼかし量を示す情報をぼかし画像生成処理部30bに出力する。
 フラグ拡大部25は、フィルタサイズ選択部23bから入力された合焦フラグを示す情報から、合焦フラグが1である領域である合焦領域を、後述する画像拡大部34がぼかし画像を拡大する倍率(例えば、4倍)と同じ倍率で拡大する。フラグ拡大部25は、拡大した合焦領域の情報を、画像合成部40bに出力する。
 ぼかし画像生成処理部30bは、第1の実施形態のぼかし画像生成処理部30と同様に、入力されたぼかし量を示す情報と、縮小した基準画像のデータとに基づいて、前景領域および背景領域のぼかし画像を生成する。ぼかし画像生成処理部30bは、生成した前景領域のぼかし画像のデータと、背景領域のぼかし画像のデータとを、画像拡大部34に出力する。
 画像拡大部34は、入力された前景領域のぼかし画像を、画像縮小部24における縮小倍率の逆数の倍率(例えば、4倍)で、公知のバイリニア補間で拡大する。同様に、画像拡大部34は、入力された背景領域のぼかし画像を、画像縮小部24における縮小倍率の逆数の倍率(例えば、4倍)で、バイリニア補間で拡大する。なお、上記補間はバイリニア補間に限定されない。
 画像拡大部34は、拡大した前景領域のぼかし画像のデータと、拡大した背景領域のぼかし画像のデータとを、画像合成部40bに出力する。
 なお、画像拡大部34は、画像縮小部24における縮小倍率の逆数の倍率でぼかし画像を拡大したが、これに限らず、最終的に取得したい合成画像の画像サイズにあわせた倍率でぼかし画像を拡大してもよい。
 画像合成部40bは、フラグ拡大部25から入力された拡大した合焦領域の情報を用いて、拡大した合焦領域に対し、外部から入力された縮小前の基準画像から合焦画像を生成する。画像合成部40bは、画像合成部40と同様に、背景領域、合焦領域、前景領域の順に各領域を合成し、合成画像を生成する。画像合成部40bは、生成した合成画像のデータIMGDATAOUTを外部に出力する。
 図14は、本発明の第2の実施形態における画像処理装置10bの処理の流れを示したフローチャートである。まず、画像縮小部24は、基準画像および参照画像を所定の倍率(例えば、4分の1)に縮小する(ステップS301)。
 次に、視差マップ生成部12bは、縮小した基準画像および縮小した参照画像からブロックマッチングにより視差マップを求める(ステップS302)。
 次に、領域毎の視差値変換部21は、縮小した基準画像および視差マップを前景領域、合焦領域、背景領域に分割する(ステップS303)。
 次に、LPF処理部(マップ用フィルタ処理部)22は、視差マップにLPFをかける(ステップS304)。
 次に、ぼかし画像生成処理部30bは、縮小した基準画像の前景領域に対し、変換した視差値に対応するぼかし量(テーブル)を算出する(ステップS305)。
 次に、ぼかし画像生成処理部30bは、縮小した基準画像の前景領域に対し、図12に示された処理の流れで、ぼかし量(テーブル)から対応するカーネルサイズのぼかし画像を選択し、変換した視差値に応じたぼかし画像生成処理を行う(ステップS306)。
 次に、ぼかし画像生成処理部30bは、縮小した基準画像の背景領域に対し、変換した視差値に対応するぼかし量(テーブル)を算出する(ステップS307)。
 次に、ぼかし画像生成処理部30bは、縮小した基準画像の背景領域に対し、図12に示された処理の流れで、ぼかし量(テーブル)から対応するカーネルサイズのぼかし画像を選択し、変換した視差値に応じたぼかし画像生成処理を行う(ステップS308)。
 次に、画像拡大部34は、前景領域のぼかし画像および背景領域のぼかし画像に対し、バイリニア補間を用いて所定の倍率(例えば、4倍)で拡大する。次に、フラグ拡大部25は、合焦フラグをニアレストネイバー法にて拡大する(ステップS310)。
 次に、画像合成部40bは、拡大した合焦フラグを用いて、縮小前の基準画像から合焦画像を生成する(ステップS311)。
 次に、画像合成部40bは、背景領域、合焦領域、前景領域の順に各領域を合成する(ステップS312)。
 以上で、図14のフローチャートの処理を終了する。
 これにより、画像処理装置10bは、入力画像である基準画像と参照画像の縮小により、奥行分解能が減り、1つの被写体内の奥行値の変化が小さくなる。そのため、奥行き方向に変化する被写体の途中からぼけが発生する頻度を削減することができる。
 また、本発明の第1の実施形態による画像処理装置10(図2参照)および本発明の第2の実施形態による画像処理装置10b(図13参照)の各処理を実行するためのプログラムをコンピュータ読み取り可能な記録媒体に記録してもよい。そして、その記録媒体に記録されたプログラムをコンピュータシステムに読み込ませ、実行することにより、画像処理装置10、画像処理装置10bに係る上述した種々の処理を行ってもよい。
 なお、ここでいう「コンピュータシステム」とは、OS(Operating System)や周辺機器等のハードウェアを含むものであってもよい。また、「コンピュータシステム」は、WWW(World Wide Web)システムを利用している場合であれば、ホームページ提供環境(あるいは表示環境)も含む。また、「コンピュータ読み取り可能な記録媒体」とは、フレキシブルディスク、光磁気ディスク、ROM(Read Only Memory)、フラッシュメモリ等の書き込み可能な不揮発性メモリ、CD-ROM(Compact Disc-Read Only Memory)等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置のことをいう。
 さらに「コンピュータ読み取り可能な記録媒体」とは、インターネット等のネットワークや電話回線等の通信回線を介してプログラムが送信された場合のサーバやクライアントとなるコンピュータシステム内部の揮発性メモリ(例えばDRAM(Dynamic Random Access Memory))のように、一定時間プログラムを保持しているものも含む。また、上記プログラムは、このプログラムを記憶装置等に格納したコンピュータシステムから、伝送媒体を介して、あるいは、伝送媒体中の伝送波により他のコンピュータシステムに伝送されてもよい。ここで、プログラムを伝送する「伝送媒体」は、インターネット等のネットワーク(通信網)や電話回線等の通信回線(通信線)のように情報を伝送する機能を有する媒体のことをいう。また、上記プログラムは、前述した機能の一部を実現するためのものであっても良い。さらに、前述した機能をコンピュータシステムにすでに記録されているプログラムとの組み合わせで実現できるもの、いわゆる差分ファイル(差分プログラム)であっても良い。
 以上、本発明の実施形態について図面を参照して詳述したが、具体的な構成はこの実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の設計等も含まれる。
 本発明は、被写体と背景または前景の境界領域においてなだらかなぼけとなる画像を生成する画像処理装置、画像処理方法及び画像処理プログラムなどに適用することができる。
10、10b・・・画像処理装置、
11・・・記憶部、
12、12b・・・視差マップ生成部、
20、20b・・・ぼかし係数算出処理部、
21・・・領域毎の視差値変換部(領域分割部)、
22・・・LPF処理部(マップ用フィルタ処理部)、
23・・・ぼかし領域選択部(フィルタサイズ選択部)、
24・・・画像縮小部、
25・・・フラグ拡大部、
30・・・ぼかし画像生成処理部、
31・・・基準ぼかし画像生成部、
32・・・基準ぼかし画像選択部、
33・・・画素値補間部、
34・・・画像拡大部、
40、40b・・・画像合成部

Claims (8)

  1.  画像の各画素についての視差値に基づく視差マップにフィルタをかけるマップ用フィルタ処理部と、
     前記画像から前記画像のぼかし画像を生成するぼかし画像生成部と、
     前記マップ用フィルタ処理部によるフィルタ後の視差マップに基づいて、前記画像と前記ぼかし画像とを合成した合成画像を生成する画像合成部と、
     を備える画像処理装置。
  2.  前記マップ用フィルタ処理部によりフィルタがかけられた視差マップに応じて画像用フィルタのサイズを選択するフィルタサイズ選択部を備え、
     前記ぼかし画像生成部は、前記画像に前記画像用フィルタをかけることにより、前記ぼかし画像を生成する請求項1に記載の画像処理装置。
  3.  前記画像を前記視差値に応じて所定の領域に分割し、前記領域毎に視差値を変換する領域分割部を備え、
     前記マップ用フィルタ処理部は、前記領域分割部により視差値が変換された視差マップにフィルタをかける請求項1に記載の画像処理装置。
  4.  前記画像のサイズを縮小する画像縮小部を備え、
     前記ぼかし画像生成部は、前記画像縮小部により縮小された画像のぼかし画像を生成し、
     前記縮小された画像のぼかし画像を所定のサイズに拡大する画像拡大部を備える請求項1に記載の画像処理装置。
  5.  前記ぼかし画像生成部は、
     視差マップから複数の値を選択し、前記選択した複数の値のそれぞれに応じたぼかし量を持つ基準ぼかし画像を生成する基準ぼかし画像生成部と、
     前記画像の注目画素毎に、前記注目画素の前記フィルタ後の視差マップの値と前記選択した値との比較に基づいて、前記基準ぼかし画像から基準ぼかし画像を選択する基準ぼかし画像選択部と、
     前記選択された基準ぼかし画像のうち前記注目画素の位置に相当する画素の画素値と前記注目画素のフィルタ後の視差マップの値と前記選択した値とに基づいて、前記注目画素の画素値を算出する画素値補間部と、
     を備える請求項1に記載の画像処理装置。
  6.  前記画素値補間部は、前記注目画素のフィルタ後の視差マップの値と前記選択した値とに基づく値と、前記選択された基準ぼかし画像のうち前記注目画素の位置に相当する画素の画素値とを用いた補間によって、前記注目画素の画素値を算出する請求項5に記載の画像処理装置。
  7.  画像の各画素についての視差値に基づく視差マップにフィルタをかけ、
     前記画像から前記画像のぼかし画像を生成し、
     フィルタをかけた後の視差マップに基づいて、前記画像と前記ぼかし画像とを合成した合成画像を生成する画像処理方法。
  8.  画像処理装置のコンピュータに、
     画像の各画素についての視差値に基づく視差マップにフィルタをかけさせ、
     前記画像から前記画像のぼかし画像を生成させ、
     フィルタをかけた後の視差マップに基づいて、前記画像と前記ぼかし画像とを合成した合成画像を生成させる画像処理プログラム。
PCT/JP2011/070832 2010-12-03 2011-09-13 画像処理装置、画像処理方法及び画像処理プログラム WO2012073575A1 (ja)

Priority Applications (4)

Application Number Priority Date Filing Date Title
BR112013013356A BR112013013356A2 (pt) 2010-12-03 2011-09-13 dispositivo de processamento de imagem, método de processamento de imagem e programa de processamento de imagem
CN2011800582100A CN103238168A (zh) 2010-12-03 2011-09-13 图像处理装置、图像处理方法及图像处理程序
JP2012546719A JP5473173B2 (ja) 2010-12-03 2011-09-13 画像処理装置、画像処理方法及び画像処理プログラム
US13/990,464 US9070223B2 (en) 2010-12-03 2011-09-13 Image processing device, image processing method, and image processing program

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2010270735 2010-12-03
JP2010-270735 2010-12-03

Publications (1)

Publication Number Publication Date
WO2012073575A1 true WO2012073575A1 (ja) 2012-06-07

Family

ID=46171531

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2011/070832 WO2012073575A1 (ja) 2010-12-03 2011-09-13 画像処理装置、画像処理方法及び画像処理プログラム

Country Status (5)

Country Link
US (1) US9070223B2 (ja)
JP (1) JP5473173B2 (ja)
CN (1) CN103238168A (ja)
BR (1) BR112013013356A2 (ja)
WO (1) WO2012073575A1 (ja)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014158070A (ja) * 2013-02-14 2014-08-28 Canon Inc 画像処理装置、撮像装置、画像処理方法、画像処理プログラム、および、記憶媒体
EP2709057A3 (en) * 2012-09-18 2016-11-09 Facebook, Inc. System, method and computer program product for image processing, in particular for introducing blurring effects to an image
US11580193B2 (en) 2017-06-22 2023-02-14 Nec Corporation Computation device, computation method, and program

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9886766B2 (en) * 2013-08-16 2018-02-06 Samsung Electronics Co., Ltd Electronic device and method for adding data to image and extracting added data from image
JP5788551B1 (ja) * 2014-03-27 2015-09-30 オリンパス株式会社 画像処理装置および画像処理方法
CN105872408A (zh) * 2015-12-04 2016-08-17 乐视致新电子科技(天津)有限公司 图像处理方法及设备
CN108076291A (zh) * 2017-12-28 2018-05-25 北京安云世纪科技有限公司 一种图像数据的虚化处理方法、装置和移动终端
CN113256785B (zh) * 2021-05-31 2023-04-04 北京字跳网络技术有限公司 图像处理方法、装置、设备及介质
CN114626978A (zh) * 2022-03-17 2022-06-14 北京字跳网络技术有限公司 一种图像处理方法、装置、计算机设备以及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09181966A (ja) * 1995-12-22 1997-07-11 Olympus Optical Co Ltd 画像処理方法及び装置
JP2006067521A (ja) * 2004-08-30 2006-03-09 Kyocera Corp 画像処理装置と方法、および画像撮像装置と方法
JP2009110137A (ja) * 2007-10-29 2009-05-21 Ricoh Co Ltd 画像処理装置、画像処理方法及び画像処理プログラム

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6163337A (en) 1996-04-05 2000-12-19 Matsushita Electric Industrial Co., Ltd. Multi-view point image transmission method and multi-view point image display method
JP3733359B2 (ja) 1996-04-05 2006-01-11 松下電器産業株式会社 視差推定方法、画像伝送方法、画像表示方法、多視点画像伝送方法、多視点画像復元方法および視差推定装置
JP3262772B2 (ja) 1999-12-17 2002-03-04 株式会社ナムコ 画像生成システム及び情報記憶媒体
US7113634B2 (en) * 2001-07-31 2006-09-26 Canon Kabushiki Kaisha Stereoscopic image forming apparatus, stereoscopic image forming method, stereoscopic image forming system and stereoscopic image forming program
US8073196B2 (en) * 2006-10-16 2011-12-06 University Of Southern California Detection and tracking of moving objects from a moving platform in presence of strong parallax
JP4793933B2 (ja) 2007-03-12 2011-10-12 任天堂株式会社 画像処理プログラムおよび画像処理装置
JP2009194896A (ja) * 2008-01-18 2009-08-27 Sanyo Electric Co Ltd 画像処理装置及び方法並びに撮像装置
EP2286385A4 (en) * 2008-06-06 2013-01-16 Reald Inc TRUNKING GAIN STEREOSCOPIC IMAGES
JP2011130169A (ja) 2009-12-17 2011-06-30 Sanyo Electric Co Ltd 画像処理装置及び撮影装置
KR101690297B1 (ko) * 2010-04-12 2016-12-28 삼성디스플레이 주식회사 영상 변환 장치 및 이를 포함하는 입체 영상 표시 장치
RU2010123652A (ru) * 2010-06-10 2011-12-20 Корпорация "САМСУНГ ЭЛЕКТРОНИКС Ко., Лтд." (KR) Система и способ визуализации стереоизображений и многовидовых изображений для управления восприятием глубины стереоскопического изображения, создаваемого телевизионным приемником
JP5175910B2 (ja) * 2010-09-16 2013-04-03 株式会社東芝 画像処理装置、画像処理方法およびプログラム
US8878950B2 (en) * 2010-12-14 2014-11-04 Pelican Imaging Corporation Systems and methods for synthesizing high resolution images using super-resolution processes

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09181966A (ja) * 1995-12-22 1997-07-11 Olympus Optical Co Ltd 画像処理方法及び装置
JP2006067521A (ja) * 2004-08-30 2006-03-09 Kyocera Corp 画像処理装置と方法、および画像撮像装置と方法
JP2009110137A (ja) * 2007-10-29 2009-05-21 Ricoh Co Ltd 画像処理装置、画像処理方法及び画像処理プログラム

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2709057A3 (en) * 2012-09-18 2016-11-09 Facebook, Inc. System, method and computer program product for image processing, in particular for introducing blurring effects to an image
US9772771B2 (en) 2012-09-18 2017-09-26 Facebook, Inc. Image processing for introducing blurring effects to an image
US10430075B2 (en) 2012-09-18 2019-10-01 Facebook, Inc. Image processing for introducing blurring effects to an image
JP2014158070A (ja) * 2013-02-14 2014-08-28 Canon Inc 画像処理装置、撮像装置、画像処理方法、画像処理プログラム、および、記憶媒体
US11580193B2 (en) 2017-06-22 2023-02-14 Nec Corporation Computation device, computation method, and program

Also Published As

Publication number Publication date
CN103238168A (zh) 2013-08-07
JPWO2012073575A1 (ja) 2014-05-19
JP5473173B2 (ja) 2014-04-16
BR112013013356A2 (pt) 2016-09-13
US20130279799A1 (en) 2013-10-24
US9070223B2 (en) 2015-06-30

Similar Documents

Publication Publication Date Title
JP5473173B2 (ja) 画像処理装置、画像処理方法及び画像処理プログラム
JP6094863B2 (ja) 画像処理装置、画像処理方法、プログラム、集積回路
US9412151B2 (en) Image processing apparatus and image processing method
JP5556394B2 (ja) 立体画像表示システム、視差変換装置、視差変換方法およびプログラム
JP6021541B2 (ja) 画像処理装置及び方法
JP4658223B2 (ja) 画像生成方法、装置、およびそのプログラム並びにプログラムを記録した記録媒体
JP2013513318A (ja) オプティカル効果を生成させるためのデジタル画像合成
JP5942195B2 (ja) 3次元画像処理装置、3次元撮像装置および3次元画像処理方法
JP2009251839A (ja) 画像信号処理回路、画像表示装置、および画像信号処理方法
WO2014083752A1 (ja) 別視点画像生成装置および別視点画像生成方法
JP6087612B2 (ja) 画像処理装置および画像処理方法
JP5820985B2 (ja) 立体画像処理装置および立体画像処理方法
JP2013228798A (ja) 画像処理装置、撮像装置、内視鏡、プログラム及び画像処理方法
JP6270413B2 (ja) 画像処理装置、撮像装置、および画像処理方法
JP5911166B2 (ja) 画像処理装置、画像処理方法、画像処理プログラム、撮像装置、及び画像表示装置
WO2012169174A1 (ja) 画像処理装置および画像処理方法
JP5820716B2 (ja) 画像処理装置、画像処理方法、コンピュータプログラム、記録媒体、立体画像表示装置
JP5482589B2 (ja) 画像処理装置、画像処理方法および画像処理用プログラム
WO2012081332A1 (ja) 画像処理装置、画像処理方法及び画像処理プログラム
JP2010171624A (ja) 輪郭補正回路及び補間画素生成回路
JP2015220662A (ja) 画像処理装置及びその制御方法、並びにプログラム
JP2020057242A (ja) 画像処理装置、画像処理方法、及びプログラム
KR101332030B1 (ko) 영상 확대방법 및 이를 수행하는 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체
JP2019517688A (ja) 二枚の表示画像間の移行を割り出すための方法及び装置、並びに、車両
JP2012060246A (ja) 画像処理装置、集積回路装置

Legal Events

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

Ref document number: 11844276

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2012546719

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 13990464

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11844276

Country of ref document: EP

Kind code of ref document: A1

REG Reference to national code

Ref country code: BR

Ref legal event code: B01A

Ref document number: 112013013356

Country of ref document: BR

ENP Entry into the national phase

Ref document number: 112013013356

Country of ref document: BR

Kind code of ref document: A2

Effective date: 20130529