WO2011086901A1 - Image processing device, image capture device, and image processing program - Google Patents

Image processing device, image capture device, and image processing program Download PDF

Info

Publication number
WO2011086901A1
WO2011086901A1 PCT/JP2011/000098 JP2011000098W WO2011086901A1 WO 2011086901 A1 WO2011086901 A1 WO 2011086901A1 JP 2011000098 W JP2011000098 W JP 2011000098W WO 2011086901 A1 WO2011086901 A1 WO 2011086901A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
value
block
unit
blocks
Prior art date
Application number
PCT/JP2011/000098
Other languages
French (fr)
Japanese (ja)
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 株式会社ニコンシステム
Publication of WO2011086901A1 publication Critical patent/WO2011086901A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/50Extraction of image or video features by performing operations within image blocks; by using histograms, e.g. histogram of oriented gradients [HoG]; by summing image-intensity values; Projection analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/61Control of cameras or camera modules based on recognised objects
    • H04N23/611Control of cameras or camera modules based on recognised objects where the recognised objects include parts of the human body
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/64Computer-aided capture of images, e.g. transfer from script file into camera, check of taken image quality, advice or proposal for image composition or decision on when to take image
    • 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/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20016Hierarchical, coarse-to-fine, multiscale or multiresolution image processing; Pyramid transform
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20021Dividing image into blocks, subimages or windows
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20048Transform domain processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Definitions

  • the present invention relates to an image processing device, an imaging device, and an image processing program.
  • Patent Document 1 discloses a technique for obtaining a main subject region by obtaining a degree of difference between a feature of a certain part of an image and a feature of a part located around the part.
  • the conventional technique extracts the main subject area depending on the high frequency component. Therefore, when a portion other than the main subject region (background region) contains a high-frequency component, this portion is also extracted as the main subject region, and a preferable result cannot be obtained. Furthermore, a technique for extracting a main subject region based on an empirically assumed composition is also considered. For example, assuming that there is a main subject in the central part, the extraction is performed with emphasis on the central part of the image, or “a background line is placed on 1/3 vertical and horizontal lines or the subject is placed at the intersection of these lines. Extraction is performed according to the three-division method (1/3 rule) that “the composition will be balanced if placed.” In such a technique, there is a problem that preferable extraction may not be performed in an image having a composition other than the assumed composition.
  • an object of the present invention is to provide a means for extracting a main subject region by a method suitable for a target image without depending on a high frequency component or assuming an empirical composition. It is in.
  • An image processing apparatus includes an acquisition unit that acquires information on a target image to be processed, an area division unit that divides the target image into a plurality of blocks, and the target image among the plurality of blocks.
  • a setting unit that sets one or more templates based on an image of one or more blocks existing in the outer periphery of the image, and a calculation unit that calculates a representative value for each of the plurality of blocks obtained by dividing the target image
  • the matching unit that performs the matching by comparing the representative value of the block to be matched with the representative value in the one or more templates for each of the plurality of blocks, and the matching result by the matching unit
  • a creation unit that creates a map indicating the distribution of the subject in the target image.
  • the image processing apparatus further includes a generation unit that generates at least one image having a lower resolution than the target image, and the region dividing unit divides the target image and the low resolution image into a plurality of blocks, respectively, and sets the setting.
  • the unit sets the one or more templates for each of the target image and the low resolution image, and the matching unit performs the matching for each of the target image and the low resolution image, and
  • the creation unit creates a map showing the distribution of the subject for each of the target image and the low-resolution image, and performs the calculation based on the plurality of created maps to thereby show the distribution of the subject in the target image. You may create a map.
  • the generation unit may generate at least one low-resolution image by performing a process of suppressing or transmitting a specific frequency band on the target image.
  • the generation unit may generate at least one low-resolution image by performing at least one of low-pass processing and resizing processing on the target image.
  • the generation unit may generate at least one low-resolution image by performing a band pass filter process on the target image.
  • the setting unit may set the one or more templates based on images of all blocks existing on the outer periphery of the target image.
  • the setting unit sets the one or more templates based on images of all blocks existing on three sides except the lower side of the target image, or sets all the existing images on the three sides.
  • the one or more templates are set based on the image of the block and the image of some predetermined blocks existing on the lower side, or the images of all the blocks existing on the left side and the right side
  • the one or more templates may be set based on
  • the acquisition unit further acquires posture information of the imaging device at the time of capturing the target image, and the setting unit selects one or more blocks from the plurality of blocks based on the posture information,
  • the one or more templates may be set based on an image of the selected block.
  • the setting unit selects some blocks from all the blocks existing on the outer periphery of the target image based on the position of the matching target block in the target image, and selects a plurality of selected blocks
  • the one or more templates may be set based on the image.
  • the calculating unit calculates a pixel value for each pixel included in the block as the representative value, and the matching unit is based on a difference between pixel values of arbitrary pixels in the matching target block, An evaluation value related to the matching target block may be used.
  • the calculation unit calculates a pixel value for each pixel included in the block as the representative value
  • the matching unit calculates a pixel value of an arbitrary pixel in the block to be matched and an arbitrary template block
  • the difference absolute value sum which is a value obtained by obtaining and adding the absolute value of the difference from the pixel value of the pixel at the position corresponding to the arbitrary pixel for all the pixels in the matching target block
  • Each of the two or more templates may be obtained, and a minimum value of the difference absolute value sum among the obtained plurality of difference absolute value sums may be used as the evaluation value for the block to be matched.
  • the calculation unit calculates the representative value by calculating a pixel value for each pixel included in the block, and then performing image conversion to a frequency domain on the pixel value included in the block
  • the matching unit calculates an absolute value of a difference between an arbitrary representative value in a matching target block and a representative value corresponding to the arbitrary representative value in an arbitrary template block in the matching target block.
  • a sum of absolute differences which is a value obtained by obtaining and adding representative values corresponding to all pixels, is obtained for each of the one or more templates, and the smallest absolute difference among the plurality of obtained sums of absolute differences.
  • the value sum value may be used as the evaluation value for the matching target block.
  • the calculation unit calculates a plurality of representative colors and their weights by clustering or the like for the pixel values included in the block, and considers the representative colors such as EMD (Earth Move Distance) and the weights thereof. May be calculated. In that case, the number of representative colors for each block may be different.
  • EMD Earth Move Distance
  • the calculation unit may calculate the representative value by performing at least one of Fourier transform, discrete cosine transform, and wavelet transform on the pixel value included in the block.
  • the calculation unit calculates, as the representative value, a value indicating a color feature for each of the plurality of blocks based on a distribution of a plurality of color components constituting the target image
  • the matching unit includes: A sum of absolute differences, which is a value obtained by adding a difference between a representative value of a matching target block and a representative value of a block of an arbitrary template, is obtained for each of the one or more templates, and the plurality of obtained absolute differences Among the value sums, at least one of the minimum value of the difference absolute value sum, the value of the maximum difference absolute value sum, and the average value of the sum of difference absolute values is the evaluation related to the block to be matched. It is good as a value.
  • the calculation unit may calculate at least one of a value indicating a representative color based on a histogram and a value indicating a feature amount based on a relative histogram as the representative value.
  • the creation unit may compare the evaluation value with a threshold value determined according to a range of values that the evaluation value can take, and create the map based on the comparison result.
  • the value in the map created by the creating unit is compared with a predetermined threshold value, Based on the comparison result, an additional setting unit that newly adds one or more templates is further provided, and the matching unit includes the representative value of the block to be matched and the one or more added by the additional setting unit. Matching is performed for each of the plurality of blocks by comparing each of the representative values in the template, and the creation unit is a map showing the distribution of subjects in the target image based on the result of matching by the matching unit May be created.
  • the map created by the creation unit is subjected to at least one of a labeling process and a grouping process by clustering, so that the plurality of subjects are detected. You may further provide the process part which performs the process which makes identification possible.
  • the display unit may display a region on the target image corresponding to a region where a value in the map exceeds a predetermined threshold value so as to be visible.
  • an image processing unit may be further provided that performs a trimming process on an area on the target image corresponding to an area where a value in the map exceeds a predetermined threshold with respect to the target image.
  • An imaging apparatus includes an imaging unit that captures an image of a subject and any of the image processing apparatuses described above, and the acquisition unit acquires information on the target image from the imaging unit.
  • an image processing unit may be further provided for the target image to perform a trimming process on a region on the target image corresponding to a region whose value in the map exceeds a predetermined threshold.
  • control unit that performs at least one of focus adjustment control and exposure control during imaging by the imaging unit based on the map may be further provided.
  • control unit that monitors at least one of the size and the position of the main subject based on the map and starts imaging by the imaging unit according to the monitoring result.
  • the imaging unit has at least one of an optical zoom function and an electronic zoom function, and executes at least one of the optical zoom function and the electronic zoom function by the imaging unit based on the map. good.
  • a program that causes a computer to operate as an image processing apparatus according to an aspect a storage medium that stores the program, and an operation of the image processing apparatus according to an aspect expressed in a method category are also specific examples of the present invention. It is effective as a specific embodiment.
  • FIG. 1 is a block diagram illustrating a configuration example of an image processing apparatus according to a first embodiment.
  • a flow chart showing an example of operation of an image processing device in a 1st embodiment.
  • Another flowchart which shows the operation example of the image processing apparatus in 1st Embodiment.
  • segmentation in 1st Embodiment The figure which shows the example of a template setting in 1st Embodiment
  • the figure which shows the example of the automatic crop in 1st Embodiment The figure which shows the example of a template setting in 3rd Embodiment
  • the figure which shows the example of a template setting in 4th Embodiment The figure which shows the example of the block division
  • Flowchart showing an example of operation of the image processing apparatus in the seventh embodiment The block diagram which shows the structural example of the electronic camera in 8th Embodiment.
  • FIG. 1 is a block diagram illustrating a configuration example of an image processing apparatus according to the first embodiment.
  • the image processing apparatus according to the first embodiment is configured by a personal computer in which an image processing program for creating a map indicating the distribution of a subject is installed with respect to a processing target image (target image) captured by the imaging apparatus.
  • an image processing program for creating a map indicating the distribution of a subject is installed with respect to a processing target image (target image) captured by the imaging apparatus.
  • the 1 includes a data reading unit 12, a storage device 13, a CPU 14, a memory 15, an input / output I / F 16, and a bus 17.
  • the data reading unit 12, the storage device 13, the CPU 14, the memory 15, and the input / output I / F 16 are connected to each other via a bus 17.
  • an input device 18 keyboard, pointing device, etc.
  • a monitor 19 are connected to the computer 11 via an input / output I / F 16.
  • the input / output I / F 16 receives various inputs from the input device 18 and outputs display data to the monitor 19.
  • the data reading unit 12 is used when reading the target image data and the image processing program from the outside.
  • the data reading unit 12 communicates with a reading device (such as an optical disk, a magnetic disk, or a magneto-optical disk reading device) that acquires data from a removable storage medium, or an external device in accordance with a known communication standard. It consists of communication devices (USB interface, LAN module, wireless LAN module, etc.) to be performed.
  • the storage device 13 is constituted by a storage medium such as a hard disk or a nonvolatile semiconductor memory, for example.
  • the storage device 13 includes an image storage unit 21 that records an image and a map storage unit 22 that records a map to be described later.
  • the storage device 13 stores an image processing program and various data necessary for executing the program.
  • the storage device 13 can also store the data of the target image read from the data reading unit 12.
  • the CPU 14 is a processor that comprehensively controls each part of the computer 11.
  • the CPU 14 functions as a low-pass image generation unit 23, a region division unit 24, a template setting unit 25, a matching processing unit 26, and a map creation unit 27 by executing the above-described image processing program (low-pass image generation).
  • the operations of the unit 23, the region dividing unit 24, the template setting unit 25, the matching processing unit 26, and the map creating unit 27 will be described later).
  • the memory 15 temporarily stores various calculation results (such as variables and flag values) in the image processing program.
  • the memory 15 is composed of, for example, a volatile SDRAM.
  • Step S101 The CPU 14 obtains data of the target image designated by the user from the outside via the data reading unit 12. Note that when the target image data is stored in advance in the image storage unit 21 of the storage device 13 or the like, the CPU 14 may omit the process of S101.
  • the acquired target image is denoted as Img [1].
  • Step S102 The CPU 14 causes the low-pass image generation unit 23 to generate the low-pass images Img [2] and Img [3] based on the image data of the target image Img [1] acquired in step S101.
  • the generation of the low-pass image Img [2] is performed by the following equations 1 and 2
  • the generation of the low-pass image Img [3] is performed by the following equations 3 and 4.
  • Equation 1 the data of the target image Img [1] is orthogonally transformed into an expression in the frequency domain by Fourier transformation.
  • ( ⁇ x, ⁇ y) in Equation 1 indicates coordinates in the frequency space, and fq1 indicates a predetermined threshold (details of fq will be described later).
  • Expression 2 an inverse Fourier transform is performed on F (LImg [2]) obtained by Expression 1 to generate a low-pass image Img [2] subjected to band limitation.
  • the low-pass image Img [3] is generated by performing Fourier transform and inverse Fourier transform on the data of the target image Img [1] using Equation 3 and Equation 4. .
  • fq1 in Expression 1 and fq2 in Expression 3 are threshold values that are determined in advance based on the height, width, diagonal line, and the like of the target image. fq1 and fq2 may be the same value or different values.
  • the low-pass images Img [2] and Img [3] are generated based on the image data of the target image Img [1].
  • the image data of the target image Img [1] Based on this, the low-pass image Img [2] may be generated, and the low-pass image Img [3] may be generated based on the image data of the generated low-pass image Img [2].
  • low-pass processing is performed to generate low-pass images Img [2] 2 and Img [3], which are lower resolution images than the target image Img [1].
  • a similar image can be created by applying processing for suppressing or transmitting a specific frequency band to 1].
  • bandpass filter processing may be performed on the target image Img [1] using the following Expression 5 and Expression 2 described above.
  • Equation 5 represents a bandpass filter in the frequency domain.
  • the data of the target image Img [1] is orthogonally transformed into an expression in the frequency domain by Fourier transformation.
  • ( ⁇ x, ⁇ y) in Equation 5 represents coordinates in the frequency space
  • fq3 and fq4 represent predetermined threshold values.
  • These fq3 and fq4 are threshold values that are determined in advance based on the height, width, diagonal line, and the like of the target image, similarly to the above-described fq1 and fq2. Any of fq3 and fq4 may be the same value as fq1 and fq2, or may be a different value.
  • inverse Fourier transform is performed on F (BImg [2]) obtained by Equation 5 using Equation 2 described above to generate a bandpass image Img [2] subjected to band limitation. .
  • bandpass images Img [2] and Img [3] may be generated based on the image data of the target image Img [1], or the target image Img [1].
  • the bandpass Img [2] may be generated based on the image data, and the bandpass image Img [3] may be generated based on the image data of the generated bandpass image Img [2].
  • band-pass filter processing is used instead of low-pass processing, for example, when the target image Img [1] is an image with a gentle gradation such as a sunset sky, matching processing described later is effective. It is preferable to apply a band pass filter that suppresses or transmits only a specific frequency band so as to function.
  • Step S103 The CPU 14 divides the target image Img [1] acquired in step S101 and the low-pass images Img [2] and Img [3] generated in step S102 into a plurality of blocks at equal intervals by the region dividing unit 24, respectively. .
  • the region dividing unit 24 in the first embodiment equally divides the target image Img [1], the low-pass images Img [2], and Img [3] into blocks of 10 ⁇ 10 each.
  • each block indicates the type of image with [n], indicates the position of the block with (i, j), and is denoted as block B [n] (i, j).
  • n indicates the type of image
  • i indicates the position in the horizontal direction
  • j indicates the order in the vertical direction.
  • the block at the upper left corner of the target image Img [1] is the start point and is expressed as block B [1] (1,1)
  • the block at the lower right corner is the end point
  • block B [1] (10, 10 ). See FIG. 4).
  • the number of block divisions is determined in advance in consideration of processing accuracy and processing speed.
  • the number of divisions of the target image Img [1], the low-pass images Img [2], and Img [3] may be the same or different.
  • Step S104 The CPU 14 uses the template setting unit 25 to select a block existing on the outermost periphery from a plurality of blocks obtained by the division processing in S103 and set it as a template.
  • the template setting unit 25 performs template setting for each of the target image Img [1], the low-pass images Img [2], and Img [3].
  • the template setting unit 25 selects a block (a block indicated by hatching in FIG. 5) existing on the outermost periphery of the target image Img [1] and sets it as a template. That is, among the plurality of blocks shown in FIG. 4, 10 blocks from block B [1] (1,1) to block B [1] (10,1) existing on the upper side and blocks existing on the left side B [1] (1,2) to B [1] (1,9), and eight blocks B [1] (10,2) to B [1] (10, 9) 8 blocks and 10 blocks of blocks B [1] (1,10) to B [1] (10,10) existing on the lower side as a template.
  • a block a block indicated by hatching in FIG. 5
  • the block set as a template in step S104 is “a block that exists on the outermost periphery among the blocks”.
  • each template is represented as a template T [1] ⁇ N ⁇ .
  • T [1] ⁇ N ⁇ the number of templates from the upper left to the lower right, and each template is represented as a template T [1] ⁇ N ⁇ .
  • the template setting unit 25 performs the same processing for each of the low-pass images Img [2] and Img [3].
  • the templates T [2] ⁇ 1 ⁇ to T [2] ⁇ 36 ⁇ is set, and the template T [3] ⁇ 1 ⁇ to template T [3] ⁇ 36 ⁇ are set for the low-pass image Img [3].
  • Step S105 The CPU 14 performs matching processing on each of the target image Img [1], the low-pass images Img [2], and Img [3] by the matching processing unit 26.
  • the matching processing unit 26 stores the image data of the image of the block B [1] (2,2) and the templates (template T [1] ⁇ 1 ⁇ to template T [1] ⁇ 36 ⁇ ) set in step S104. And the difference absolute value sum SAD [1] (i, j) ⁇ N ⁇ shown in the following equation is obtained.
  • Equation 6 The difference absolute value sum SAD [1] (i, j) ⁇ N ⁇ obtained by Equation 6 decreases as the matching degree between the matching target block and the template increases.
  • the matching process is performed.
  • the matching processing unit 26 performs the same processing for each of the block B [1] (2,2) and the templates T [1] ⁇ 2 ⁇ to the templates T [1] ⁇ 36 ⁇ , and calculates the absolute value sum. SAD [1] (2,2) ⁇ 2 ⁇ to absolute value sum SAD [1] (2,2) ⁇ 36 ⁇ are obtained. Then, an evaluation value SAD [1] (2,2) for the block B [1] (2,2) is obtained using the following equation.
  • the min (X) on the right side of Expression 7 is an expression that returns the minimum value of X.
  • the absolute value sum SAD [1] (2,2) ⁇ 1 ⁇ to the absolute value sum SAD [1] ( 2,2) Let the minimum value of ⁇ 36 ⁇ be the evaluation value SAD [1] (2,2).
  • the matching processing unit 26 performs the above processing also for the block B [1] (3,2) to the block B [1] (9,9), and the evaluation value SAD [1] (3,2) ⁇ The evaluation value SAD [1] (9, 9) is obtained.
  • the value SAD [1] (i, j) is determined.
  • the matching processing unit 26 performs the same processing for each of the low-pass images Img [2] and Img [3].
  • the evaluation value SAD [2] (2, 2) ⁇ Evaluation value SAD [2] (9,9) is obtained, and evaluation value SAD [3] (2,2) to evaluation value SAD [3] (9,9) is obtained for the low-pass image Img [3].
  • the matching process is not performed for the block set in the template in step S104 is shown, but the matching process may be similarly performed for the block set in the template.
  • the value of the evaluation value SAD [1] , (i, j) is 0.
  • Step S106 The CPU 14 uses the map creation unit 27 to create a map for each of the target image Img [1], the low-pass image Img [2], and Img [3].
  • map creation unit 27 Based on the evaluation value SAD [1] (2,2) to evaluation value SAD [1] (9,9) obtained in step S105 for the target image Img [1], the map creation unit 27 performs the target image Img [1]. ] Map Sal [1] is created.
  • the map creation unit 27 compares the evaluation value SAD [1] (2,2) to the evaluation value SAD [1] (9,9) obtained in step S105 with the threshold value TH, and assigns the pixel value to each block. To decide. For example, for the block B [1] (2,2) described above, the map creation unit 27 compares the evaluation value SAD [1] (2,2) with the threshold value TH and calculates SAD [1] (2,2). )> If the threshold value TH is satisfied, the pixel values of all the pixels in the block B [1] (2,2) are replaced with the values of SAD [1] (2,2). On the other hand, when SAD [1] (2,2) ⁇ threshold TH, the map creating unit 27 sets the pixel values of all the pixels in the block B [1] (2,2) to zero.
  • the threshold value TH is determined according to a threshold value determined according to a range that the evaluation value SAD [n] ⁇ ⁇ (i, j) obtained in step S105 can take (for example, the evaluation value SAD). [n] is about 10% below the range that can be taken by (i, j)).
  • the smaller this threshold TH the higher the possibility that a main subject is present in the block corresponding to the evaluation value to be compared (the possibility that it is not a background area), and the larger this threshold TH is.
  • the possibility that it is estimated that the main subject does not exist increases.
  • SAD [1] 2 , (2,2)> threshold TH it can be estimated that the main subject exists in block B [1] (2,2), that is, block B [1] (2 , 2) is a case where it can be estimated that it is not a background region.
  • the pixel values corresponding to the main subject are assigned by replacing the pixel values of all the pixels in the block B [1] (2,2) with the values of SAD [1] (2,2). be able to.
  • SAD [1] (2,2) ⁇ threshold TH it can be estimated that there is no main subject in block B [1] (2,2), that is, block B [1] ( 2, 2) is a case where it can be estimated that it is a background region.
  • pixel values corresponding to the background area can be assigned by setting the pixel values of all the pixels in the block B [1] (2, 2) to 0.
  • each block (36 blocks corresponding to template T [1] ⁇ 1 ⁇ to template T [1] ⁇ 36 ⁇ , see FIG. 5) set as a template in step S104, the map creating unit 27 All pixel values in each block are set to 0. This is because these blocks can be estimated to be the background region without comparison with the threshold value TH described above.
  • the map to which the new pixel value is assigned for each block by the above-described processing is the map Sal [1] related to the target image Img [1].
  • the map creation unit 27 performs the same processing for each of the low-pass images Img [2] and Img [3], creates a map Sal [2] for the low-pass image Img [2], and creates the low-pass image Img. For [3], a map Sal [3] is created. Note that, in the creation of the maps related to the low-pass images Img [2] and Img [3], the same threshold value TH used for creating the map related to the target image Img [1] may be used, or a different threshold value may be used. Also good.
  • the map creation unit 27 is based on the map Sal [1] regarding the target image Img [1], the map Sal [2] regarding the low-pass image Img [2] 2, and the map Sal [3] regarding the low-pass image Img [3].
  • the final map Sal [T] is created using the following equation.
  • W1, w2, and w3 in Equation 8 indicate the weighting amount of each map.
  • the map creation unit 27 weights the map Sal [1], the map Sal [2], and the map Sal [3], and adds the pixel values of the corresponding pixels in each map, thereby adding the map Sal [ T] is created.
  • the weights w1, w2, and w3 are determined by the frequency components in the template set in step S104. For example, when the template described above is noisy, the weight w2 of the map Sal [2] relating to the low-pass image Img [2] and the weight w3 of the map Sal [3] relating to the low-pass image Img [3] are relatively increased. When the noise is low, the weight w1 of the map Sal [1] related to the target image Img [1] may be relatively increased. In addition to this, for example, when the target image Img [1] is photographed, based on the photographing mode (“portrait mode”, “landscape mode”, etc.) set in the imaging device, the result of subject recognition, and the like. The weights w1, w2, and w3 may be determined.
  • FIG. 6 shows an example of the map Sal [T] created in this way.
  • 6A shows the target image Img [1] acquired in step S101
  • FIG. 6B shows the map Sal [T] created in step S106.
  • branches, leaves, wire nets, etc. are reflected in the background portion.
  • Such a portion has been recognized as a main subject area in spite of the background in the conventional method.
  • the templates are set using the images of these portions, as shown in FIG. 6B, these portions are not misrecognized as the main subject region, but are the main subjects. Only certain bird portions will remain on the map Sal [T].
  • Step S107 The CPU 14 records the map Sal [T] obtained in step S106 in association with the target image Img [1].
  • the map Sal [T] may be recorded as supplementary information of the target image Img [1], or the map Sal [T] is identified to indicate that the information relates to the target image Img [1]. Information may be given.
  • Step S108 Based on the map Sal [T] obtained in step S106, the CPU 14 superimposes and displays the target image Img [1] and a marker indicating the main subject area on the monitor 19.
  • the CPU 14 first extracts a main subject area based on the map Sal [T].
  • the CPU 14 compares the value of each pixel of the map Sal [T] with a predetermined threshold value TR and obtains a minimum rectangular range including all pixels exceeding the threshold value TR, thereby extracting a main subject region. Note that when obtaining the minimum rectangular range, the aspect ratio may be obtained with a fixed aspect ratio.
  • the threshold value TR is a threshold value that is determined according to the range of values that can be taken by each pixel included in the map Sal [T]. The smaller the threshold value TR, the higher the possibility that the region extracted as the main subject region will be wider. The larger the threshold value TR, the higher the possibility that the region extracted as the main subject region will become narrower.
  • FIG. 7 shows an example of the main subject area extracted in this way.
  • FIG. 7A shows a diagram in which the frame Fa indicating the main subject area described above is superimposed on the map Sal [T] shown in FIG. 6B.
  • FIG. 7B shows a diagram in which the frame Fb indicating the main subject region described above is superimposed on the target image Img [1] shown in FIG. 6A.
  • the CPU 14 superimposes and displays the target image Img [1] and a frame Fb, which is a marker indicating the main subject area, on the monitor 19.
  • a frame Fb indicating the main subject area is displayed in a portion excluding branches, leaves, wire mesh, etc. reflected in the background portion.
  • FIG. 7 shows an example in which the main subject area is extracted into a rectangle
  • the present invention is not limited to this example.
  • any shape such as an ellipse, a polygon, or an irregular shape along the outline of the main subject region may be used.
  • the present invention is not limited to this example as long as the main subject area is visible.
  • the frame may blink or a predetermined color frame may be displayed. Further, the brightness and color of the main subject area and other areas may be changed and displayed.
  • CPU14 will complete
  • a series of processing is executed according to a program execution instruction by the user
  • a map for a plurality of images may be created in response to a single user instruction.
  • a series of processes may be automatically executed every time image data is read from the outside via the data reading unit 12.
  • the imaging apparatus including the image processing apparatus described in this embodiment may be configured to execute a series of processes when performing imaging.
  • the reproduction apparatus including the image processing apparatus described in the present embodiment may be configured to execute a series of processes when reproducing an image.
  • the map Sal [T] is created based on a so-called through image for composition confirmation. It can be carried out. For example, when the main subject area is smaller than a predetermined size, it is possible to perform appropriate shooting by automatically performing optical zoom or electronic zoom around the main subject area.
  • Such processing can be performed in the same manner when moving images are captured.
  • the degree of zooming can be suppressed to such an extent that the main subject area does not protrude from the finder (shootable range).
  • By performing automatic zooming it is possible to easily capture the main subject that the user wants to photograph at an appropriate zoom magnification.
  • (B) Use for AE, AF, AWB At the time of shooting, a map Sal [T] is created based on a so-called through image for composition confirmation. It can control suitably. Further, the information of the map Sal [T] may be used for subject recognition that has been performed conventionally.
  • Such processing of AF, AE, AWB, etc. can be performed in the same manner when moving images are taken.
  • the main subject area may be detected based on the map Sal [T], and AF, AE, AWB, etc. may be performed with the center of gravity of the main subject area as the center.
  • AF, AE, AWB, etc. suitable for the main subject can be executed while tracking the movement of the main subject region.
  • automatic shutter control can be performed by creating a map Sal [T] based on a through image at the time of shooting.
  • a map Sal [T] is created for a continuously generated through image at regular time intervals to detect a main subject region, and at least one of the detected size and position of the main subject region is monitored. To do.
  • a predetermined appropriate condition may be set in advance or set by the user
  • automatic shutter control is performed.
  • Such an automatic shutter control can be performed in the same manner when a moving image is taken.
  • the main subject can be automatically imaged while tracking the movement of the main subject area.
  • control conditions up to several frames before are stored, and the control conditions in the current frame are the control conditions in the previous frame. If it is significantly different from the tracking, tracking may be prohibited.
  • (C) Determination of the zoom center in a slide show In a slide show in which a plurality of images are continuously reproduced and displayed, zoom processing is often performed as a display effect when switching images. In such a case, by extracting the main subject region based on the map Sal [T], the center of the main subject region can be set as the zoom center. As a result, it is possible to perform display in accordance with the effect of “prominent main subject region (region of interest)” that is the purpose of zoom processing.
  • FIG. 8A is an example of a conventional list display.
  • FIG. 8B shows an example in which automatic cropping is performed based on the map Sal [T] and only the main subject area is displayed as a list during such display.
  • Such automatic cropping can also be applied to a confirmation image (a so-called freeze image) displayed immediately after shooting.
  • a confirmation image a so-called freeze image
  • the user can easily confirm the focus in the main subject area, confirm the camera shake, and the like.
  • an enlargement display instruction is given by the user during image reproduction, the same effect can be obtained by performing the same processing.
  • the main subject area when performing automatic cropping, the main subject area may be stretched in the vertical or horizontal direction so that the cropped image has an appropriate aspect ratio, and then the cropping process may be performed.
  • the cropping process may be performed.
  • the image processing apparatus divides the target image into a plurality of blocks, and based on the images of the plurality of blocks existing on the outer periphery of the target image among the plurality of blocks. Set the template. Then, a representative value is calculated for each of the plurality of blocks obtained by dividing the target image, and matching is performed for each of the plurality of blocks by comparing the representative value of the block to be matched with the representative value in the plurality of templates. Based on the matching result, a map showing the distribution of the subject in the target image is created.
  • the above-described outer peripheral portion of the target image is, for example, a range of about 30% of the height of the target image from the upper and lower ends of the target image, and about 30% of the width of the target image from the left and right ends of the target image. Can be considered as a range.
  • the configuration of the first embodiment by using the outer periphery of the target image as a template, it is possible to reliably detect the background area. Therefore, by extracting the main subject area using the created map, it is possible to extract the main subject area by a method suitable for the target image without depending on high-frequency components or assuming an empirical composition. It can be performed.
  • the main subject is not a face as compared with the face recognition technology that has been conventionally considered to specialize in recognizing a face as the main subject.
  • the main subject region can be preferably extracted.
  • the main subject area can be extracted from the target image without requiring various designations and settings by the user.
  • At least one image having a lower resolution than the target image is generated, and a map indicating the distribution of the subject is generated for each of the target image and the low resolution image. Since a map showing the distribution of subjects in the target image is created by performing calculations based on multiple maps, a suitable template is set even for images in which subjects other than the main subject appear in the outer periphery of the target image Can Therefore, even if a high frequency component is on the outer periphery of the target image, the main subject region can be extracted by a method suitable for the target image.
  • the low-pass images Img [2] and Img [3] are generated based on the image data of the target image Img [1] acquired in step S101. It is not limited to this example. For example, it may be configured to generate three or more low-pass images. In this case, a map Sal [n] is created for each of the plurality of generated low-pass images, and the created map Sal [n] is appropriately weighted and added, so that the map Sal [T] is the same as in the present embodiment. ] Can be created.
  • the low-pass images Img [2] and Img [3] are generated based on the image data of the target image Img [1] acquired in step S101. [2] and Img [3] need not be generated. That is, only the target image Img [1] acquired in step S101 is processed from step S103 to step S105, and the map Sal [1] related to the target image Img [1] described in step S106 is directly used as the map Sal [T. It is also good as.
  • the second embodiment is a modification of the process of S102 in the first embodiment.
  • the description of the configuration of the image processing apparatus common to the first embodiment is omitted.
  • Step S102 The CPU 14 causes the area dividing unit 24 to generate resized images Img [2] and Img [3] based on the image data of the target image Img [1] acquired in step S101.
  • the resized image Img [2] is generated according to the following Expression 9
  • the resized image Img [3] is generated according to the following Expression 10.
  • Resize (X, Y) on the right side of Expression 9 and Expression 10 is an expression indicating that X is resized with a magnification Y.
  • the area dividing unit 24 generates the resized image Img [2] by resizing the target image Img [1] at the magnification rt1, as shown in Expression 9, and also, as shown in Expression 10, the target image Img [1]. Is resized at a magnification rt2 to generate a resized image Img [3]. Note that the magnification rt1 and the magnification rt2 are predetermined magnifications, both of which are less than 1 and rt1 ⁇ rt2.
  • the resized images Img [2] and Img [3] are generated based on the image data of the target image Img [1] has been shown.
  • the image data of the target image Img [1] Based on this, the resized image Img [2] may be generated, and the resized image Img [3] may be generated based on the image data of the generated resized image Img [2].
  • the CPU 14 uses the resized images Img [2] and Img [3] instead of the low-pass images Img [2] and Img [3], and performs the same processing as in the first embodiment. .
  • the following equation is used instead of equation 8.
  • Rt1 and rt2 in Equation 11 are the magnification rt1 and the magnification rt2 at the time of the resizing process described above. Due to the resizing process, the resized images Img [2] and Img [3] are smaller in size than the target image Img [1]. Therefore, the map Sal [2] and the resized image Img [3] related to the resized image Img [2]. The size of the map Sal [3] related to is smaller than the map Sal [1] related to the target image Img [1] [.
  • step S106 when creating the map Sal [T] in step S106, weights and addition processing are performed after the sizes are adjusted by multiplying the reciprocals of the magnification rt1 and the magnification rt2 at the time of the resizing processing.
  • the image processing apparatus performs a resizing process, which is a low resolution process (band limiting process) similar to the low pass process, instead of the low pass process according to the first embodiment. Therefore, it is possible to obtain substantially the same effect as the configuration of the first embodiment.
  • the image processing apparatus according to the second embodiment can be expected to increase the processing speed by performing the resizing process instead of the low-pass process.
  • the third embodiment is a modification of the process of S104 in the first embodiment and the second embodiment.
  • the description of the configuration of the image processing apparatus common to the first embodiment and the second embodiment is omitted.
  • Step S104 The CPU 14 uses the template setting unit 25 to select all the blocks existing on the three sides excluding the lower side from the plurality of blocks obtained by the division processing in S103 and set them as templates.
  • the template setting unit 25 performs template setting for each of the target image Img [1], the low-pass images Img [2], and Img [3].
  • the template setting unit 25 selects blocks (blocks indicated by diagonal lines in FIG. 9A) existing on three sides excluding the lower side of the target image Img [1] and sets them as templates. That is, among the plurality of blocks shown in FIG. 4, 10 blocks from block B [1] (1,1) to block B [1] (10,1) existing on the upper side and blocks existing on the left side N blocks B [1] (1,2) to B [1] (1,10) and blocks B [1] (10,2) to B [1] (10, A total of 28 blocks including the 9 blocks of 10) are set as templates.
  • each template is represented as a template T [1] ⁇ N ⁇ .
  • T [1] ⁇ N ⁇ 28 blocks existing on the three sides excluding the lower side of the target image Img [1] are selected, as shown in FIG. 9, templates T [1] ⁇ 1 ⁇ to templates T [1] ] 28 templates of ⁇ 28 ⁇ are set.
  • the reason why all the blocks existing on the three sides excluding the lower side are set as the template is because the block existing on the lower side is not set as the template.
  • a main subject or an extension of the main subject
  • the lower side This is because the block existing in is not suitable as a template. If a block in which the main subject exists is set as a template, the block in which the main subject exists is extracted as a background area. In order to deal with such a problem, all blocks existing on the three sides except the lower side are set as templates.
  • the top and bottom of the image can be recognized based on the orientation information of the imaging device when the target image Img [1] is captured. Furthermore, the top and bottom of the image may be recognized based on the results of automatic subject recognition, face recognition, and the like. For example, for an image in a horizontal position as shown in FIG. 9B, blocks that are present on three sides excluding the left side of the target image Img [1] (blocks indicated by diagonal lines in FIG. 9B) are selected and set as a template. That's fine.
  • the template setting unit 25 performs the same processing for each of the low-pass images Img [2] and Img [3]. For the low-pass images Img [2], the templates T [2] ⁇ 1 ⁇ to T [2] ⁇ 28 ⁇ is set, and the template T [3] ⁇ 1 ⁇ to template T [3] ⁇ 28 ⁇ are set for the low-pass image Img [3].
  • step S105 the CPU 14 performs the same processing as in the first embodiment.
  • the templates for which the absolute difference sum SAD [1] (i, j) ⁇ N ⁇ is calculated are 28 templates T [1] ⁇ 1 ⁇ to template T [1] ⁇ 28 ⁇ . Template.
  • the image processing apparatus sets a plurality of templates based on the images of all blocks existing on the three sides of the target image except the lower side. Therefore, a suitable template can be set also for an image in which a main subject exists on the lower side of the target image. In addition, the processing speed can be increased by reducing the number of templates.
  • a plurality of templates are set based on images of all blocks existing on the three sides except the lower side. However, images of all blocks existing on the left side and the right side are shown. Based on this, a plurality of templates may be set.
  • the image of all blocks existing on the target side (all four sides in the first embodiment, three sides or two sides in the third embodiment) are included.
  • a plurality of templates may be set based on an image of some blocks.
  • the template may be set based on images of all blocks existing on three sides except the lower side and images of some predetermined blocks existing on the lower side.
  • a plurality of templates may be set based on the block images existing at the four corners.
  • the fourth embodiment is a modification of the process of S104 in the first embodiment and the second embodiment, similarly to the third embodiment described above. Therefore, as in the third embodiment, in the description of the following embodiment, the description of the configuration of the image processing apparatus common to the first embodiment and the second embodiment is omitted in this specification.
  • Step S104 The CPU 14 uses the template setting unit 25 to select a part of blocks from a plurality of blocks obtained by the division processing in S103 and all blocks existing on the outermost periphery of the image based on the position of the matching target block in the image. Select and set as template.
  • the template setting unit 25 performs template setting for each of the target image Img [1], the low-pass images Img [2], and Img [3].
  • block B [1] (6,4) block B [1] (5,1), block B [1] ( 6,1), block B [1] (7,1), block B [1] (1,3), block B [1] (1,4), block B [1] (1 5), block B [1] 1 (10,3), block B [1] (10,4), block B [1] (10,5) existing on the right side, and block B [ 1] (5, 10), block B [1] (6, 10), and block B [1] (7, 10) are selected and set as templates. That is, the template setting unit 25 sets a total of 12 blocks among the plurality of blocks shown in FIG. 4 as templates.
  • each template is represented as a template T [1] (i, j) ⁇ N ⁇ .
  • (I, j) in the template T [1] (i, j) ⁇ N ⁇ indicates that it is a template set for the block B [1] (i, j).
  • the template setting unit 25 performs the same processing for each of the low-pass images Img [2] and Img [3].
  • the block B [2] (2,2) to the block B [ 2] Template T [2] (i, j) ⁇ 1 ⁇ to template T [2] (i, j) ⁇ 12 ⁇ are set for each block of (9,9).
  • ⁇ To template T [3] (i, j) ⁇ 12 ⁇ are set.
  • step S105 the CPU 14 performs the same processing as in the first embodiment.
  • a difference absolute value sum SAD [n] (i, j) ⁇ N ⁇ is obtained using a template that is different for each block.
  • templates for which the absolute difference sum SAD [n] n ⁇ N ⁇ is calculated are, for each block, templates T [n] (i, j) ⁇ 1 ⁇ to templates T [n] (i, j). ) Twelve templates of ⁇ 12 ⁇ .
  • the template setting unit 25 uses all the positions present on the outermost periphery of the target image Img [1] based on the position of the block B [1] (i, j) in the target image Img [1].
  • three blocks are selected for each side and set as a template.
  • the configuration may be such that (2a + 1) blocks are selected for each side using the variable a (where a is an integer of 0 or more).
  • block B [1] (ia, 1) to block B [1] (i + a, 1) existing on the upper side and block B [1] (1, ja) to block B existing on the left side [1] (1, j + a), block B [1] (10, j ⁇ a) to block B [1] (10, j + a) existing on the right side, and block B [1] (i existing on the lower side -A, 10) to block B [1] (i + a, 10) may be selected and set as a template.
  • the variable a may be determined according to the number of divisions at the time of block division performed in step S103.
  • the image processing apparatus selects some blocks from all blocks existing on the outermost periphery of the target image based on the position of the matching target block in the target image.
  • a plurality of templates are set based on the images of the selected plurality of blocks.
  • the number of templates can be reduced and the processing speed can be increased as in the third embodiment.
  • a plurality of templates are set based on the image of a block existing on the outermost periphery.
  • the present invention is not limited to this example.
  • a plurality of templates may be set based on an image of a block existing on the innermost circumference of the outermost circumference.
  • a total of 22 blocks, including 7 blocks of B [1] (9, 9) may be set as a template.
  • the composition is determined to some extent, such as when the target image Img [1] is a picture in a frame.
  • the number of blocks on each side may not be the same.
  • a plurality of templates may be set based on a block image for two lines, and for the left side and the right side, a plurality of templates may be set based on a block image for one line.
  • the fifth embodiment is a modification of the process of S105 in the first to fourth embodiments described above.
  • the description of the configuration of the image processing apparatus common to the first to fourth embodiments is omitted.
  • Step S105 The CPU 14 performs matching processing on each of the target image Img [1], the low-pass images Img [2], and Img [3] by the matching processing unit 26.
  • the matching processing unit 26 performs frequency feature quantity f [1] ⁇ 1 ⁇ to frequency feature quantity f [1] ⁇ 36 ⁇ and frequency feature quantity f [1] (2,2) to frequency feature quantity f [1] ( 9 and 9) are obtained, and the evaluation value fSAD [1] i (i, j) is obtained for each portion excluding the template set in step S104 from the target image Img [1].
  • the matching processing unit 26 uses the frequency feature quantity f [1] (2,2) of the block B [1] (2,2) and the templates (template T [1] ⁇ 1 ⁇ to template T [ 1] ⁇ 36 ⁇ ) are compared with the frequency feature quantity f [1] ⁇ 1 ⁇ to the frequency feature quantity fT [1] ⁇ 36 ⁇ , respectively, and the sum of absolute differences fSAD [1] (i, j ) Find ⁇ N ⁇ .
  • the right side of Expression 14 represents the value of the frequency feature quantity f [1] (i, j) corresponding to an arbitrary pixel in the block (block B [n] (i, j)) to be matched.
  • template T [n] ⁇ N ⁇ template block
  • the absolute value of the difference from the value of the frequency feature quantity fT [1] ⁇ N ⁇ corresponding to the pixel at the position corresponding to the arbitrary pixel is calculated.
  • the matching process is performed.
  • the matching processing unit 26 performs the same processing for each of the block B [1] (2,2) and the templates T [1] ⁇ 2 ⁇ to the templates T [1] ⁇ 36 ⁇ , and calculates the absolute value sum.
  • fSAD [1] (2,2) ⁇ 2 ⁇ to absolute value sum fSAD [1] (2,2) ⁇ 36 ⁇ are obtained.
  • the evaluation value fSAD [1] (2,2) for the block B [1] (2,2) is obtained using the following equation.
  • Equation 15 The min (X) on the right side of Equation 15 is an equation that returns the minimum value of X.
  • the absolute value sum fSAD [1] (2,2) ⁇ 1 ⁇ to the absolute value sum SAD [1] ( 2,2) Let the minimum value of ⁇ 36 ⁇ be the evaluation value fSAD [1] (2,2).
  • the matching processing unit 26 performs the above processing for the block B [1] (3,2) to the block B [1] (9,9), and the evaluation value fSAD [1] (3,2) ⁇ The evaluation value fSAD [1] (9, 9) is obtained.
  • the value fSAD [1] (i, j) is determined.
  • the matching processing unit 26 performs the same processing for each of the low-pass images Img [2] and Img [3].
  • the evaluation value fSAD [2] (2,2) ⁇ Evaluation value SAD [2] (9,9) is obtained, and evaluation value fSAD [3] (2,2) to evaluation value SAD [3] (9,9) is obtained for the low-pass image Img [3].
  • the CPU 14 replaces the evaluation value SAD [1] (2,2) to the evaluation value SAD [1] (9,9) with the evaluation value fSAD [1].
  • a map Sal [1] relating to the target image Img [1] is created based on (2,2) to evaluation value fSAD [1] (9,9). The same applies to the low-pass images Img [2] and Img [3].
  • the image processing apparatus calculates the representative value by performing the Fourier transform on the pixel value included in the block after calculating the pixel value for each pixel included in the block. To do. And, the absolute value of the difference between the arbitrary representative value in the matching target block and the representative value corresponding to the arbitrary representative value in the block of the arbitrary template corresponds to all the pixels in the matching target block. A sum of absolute differences, which is a value obtained by adding and obtaining a representative value, is obtained for each of a plurality of templates, and among the plurality of obtained sums of absolute differences, a value of the minimum sum of absolute differences is calculated as a matching target. The evaluation value for the block. Therefore, it is possible to obtain substantially the same effect as the configuration of the first embodiment.
  • step S105 an example in which Fourier transform is performed in step S105 has been described.
  • any conversion process may be performed as long as image conversion to the frequency domain is performed.
  • discrete cosine transform or wavelet transform may be performed.
  • image conversion to the frequency domain may be performed by combining a plurality of methods.
  • the evaluation value for the block to be matched has been shown.
  • the maximum value or the average value may be used as the evaluation value.
  • the sixth embodiment is a modification of the process of S105 in the first to fourth embodiments, similarly to the fifth embodiment described above. Therefore, as in the fifth embodiment, in the description of the following embodiments, the description of the configuration of the image processing apparatus common to the first to fourth embodiments is omitted in this specification.
  • Step S105 The CPU 14 performs matching processing on each of the target image Img [1], the low-pass images Img [2], and Img [3] by the matching processing unit 26.
  • the matching processing unit 26 calculates the following expression for each block (block B [1] (1,1) to block B [1] (10,10)) obtained by dividing the block in step S103 for the target image Img [1].
  • the representative color feature amount is obtained by using this.
  • the representative color feature CL [1] ⁇ N ⁇ And the portion excluding the template set in step S104 from the target image Img [1] (8 ⁇ 8 64 blocks from block B [1] (2,2) to block B [1] (9,9))
  • the representative color feature amount CL [1] (i, j) is obtained using Expression 17.
  • CLr [n] ⁇ N ⁇ , CLg [n] ⁇ N ⁇ , and CLb [n] ⁇ N ⁇ on the right side of Equation 16 are respectively the maximum values for the pixel values of RGB colors in the template T [n] ⁇ N ⁇ . Indicates the mode value. When there are a plurality of mode values, the mode value corresponding to the smallest pixel value may be employed, or an average value may be employed.
  • CLr [n] (i, j), CLg [n] (i, j), and CLb [n] (i, j) on the right side of Expression 17 are respectively represented by blocks B [n] (i, j).
  • the mode value (mode) for each pixel value of each RGB color is shown.
  • the matching processing unit 26 performs block division on each block (block B [1] 1 , (1,1) to block B [1] (10,10)) in step S103.
  • a second representative color feature amount is obtained using the following equation.
  • the blocks template T [1] ⁇ 1 ⁇ to template T [1] ⁇ 36 ⁇
  • the second representative color feature value Q [ 1] ⁇ N ⁇ is obtained, and the portion excluding the template set in step S104 from the target image Img [1] (block B [1] (2,2) to block B [1] (9,9) 8 ⁇
  • the second representative color feature value Q [1] (i, j) is obtained using Equations 22 to 25.
  • Pr [n] ⁇ N ⁇ on the right side of Equation 19 represents a relative histogram of the R component in the template T [n] ⁇ N ⁇ .
  • Pg [n] ⁇ N ⁇ on the right side in Expression 20 represents a relative histogram of the G component in the template T [n] ⁇ N ⁇
  • Pb [n] ⁇ N ⁇ on the right side in Expression 21 represents the template.
  • the relative histogram of the B component in T [n] ⁇ N ⁇ is shown.
  • Pr [n] (i, j) on the right side of Equation 23 represents a relative histogram of the R component in the block B [n] (i, j).
  • Pg [n] (i, j) on the right side in Expression 24 represents a relative histogram of the G component in the block B [n] (i, j)
  • Pb [n] (i on the right side in Expression 25 shows a relative histogram of the B component in the block B [n] (i, j).
  • the range for obtaining ⁇ representing the sum is determined by the number of bins (number of divisions) in each relative histogram.
  • the matching processing unit 26 represents the representative color feature value CL [1] ⁇ 1 ⁇ to the representative color feature value CLf [1] ⁇ 36 ⁇ and the representative color feature value CL [1] (2,2) to the representative color feature value CL [ 1] (9, 9) is obtained, and the second representative color feature value Q [1] ⁇ 1 ⁇ to the second representative color feature value Q [1] ⁇ 36 ⁇ and the second representative color feature value Q [1 ] (2,2) to second representative color feature quantity Q [1] (9,9) are obtained. Then, an evaluation value V [1] (i, j) is obtained for each block from the target image Img [1] for each portion excluding the template set in step S104.
  • the matching processing unit 26 performs representative color feature value CL [1] (2,2) and second representative color feature value Q [1] (2,2) of block B [1] (2,2), and step S104.
  • the representative color feature quantity Q [1] ⁇ 1 ⁇ to the second representative color feature quantity Q [1] ⁇ 36 ⁇ are respectively compared, and the difference absolute value sum V [1] (i, j) ⁇ N ⁇
  • the matching processing unit 26 performs the same processing for each of the block B [1] (2,2) and the templates T [1] ⁇ 2 ⁇ to the templates T [1] ⁇ 36 ⁇ , and calculates the absolute value sum. V [1] (2,2) ⁇ 2 ⁇ to absolute value sum V [1] (2,2) ⁇ 36 ⁇ are obtained. Then, an evaluation value V [1] (2,2) for the block B [1] (2,2) is obtained using the following equation.
  • Min (X) on the right side of Expression 27 is an expression that returns the minimum value of X.
  • the sum of absolute values V [1] (2,2) ⁇ 1 ⁇ to the sum of absolute values V [1] ( 2,2) Let the minimum value of ⁇ 36 ⁇ be the evaluation value V [1] (2,2).
  • the matching processing unit 26 performs the above processing also for the block B [1] (3,2) to the block B [1] , (9,9), and the evaluation value V [1] (3,2) ⁇
  • the evaluation value V [1] (9, 9) is obtained.
  • the value V [1] (i, j) is determined.
  • the matching processing unit 26 performs the same processing for each of the low-pass images Img [2] and Img [3].
  • the evaluation value V [2] (2, 2) ⁇ Evaluation value V [2] (9,9) is obtained, and evaluation value V [3] (2,2) to evaluation value V [3] (9,9) is obtained for the low-pass image Img [3].
  • the CPU 14 replaces the evaluation value SAD [1] (2,2) to the evaluation value SAD [1] (9,9) with respect to the target image Img [1].
  • a map Sal [1] relating to the target image Img [1] is created based on (2,2) to evaluation value V [1] (9,9). The same applies to the low-pass images Img [2] and Img [3].
  • the image processing apparatus calculates, as a representative value, a value indicating a color feature for each of a plurality of blocks based on a distribution of a plurality of color components constituting the target image. Then, a difference absolute value sum that is a value obtained by adding the difference between the representative value of the block to be matched and the representative value of the block of an arbitrary template is obtained for each of the plurality of templates, and the obtained plurality of difference absolute value sums are obtained.
  • the smallest sum of absolute differences is set as the evaluation value for the block to be matched. Therefore, it is possible to obtain substantially the same effect as the configuration of the first embodiment.
  • the representative color feature value and the second representative color feature value have been described as examples of the value indicating the color feature, but only one of them may be used. Further, when the difference absolute value sum V [n] (i, j) ⁇ N ⁇ shown in Expression 26 is obtained, the representative color feature value and the second representative color feature value may be appropriately weighted.
  • Step S103 The CPU 14 divides the target image Img [1] acquired in step S101 and the low-pass images Img [2] and Img [3] generated in step S102 into a plurality of blocks by the area dividing unit 24, respectively.
  • the area dividing unit 24 divides the target image Img [1] into a block B [1] (1, 1) existing on the outer periphery and an 8 ⁇ 8 matrix shape existing inside the block B [1] (1, 1). Are divided into blocks B [1] (2, 2) to B [1] (9, 9).
  • the region dividing unit 24 similarly divides the low-pass images Img [2] and Img [3].
  • Step S104 The CPU 14 uses the template setting unit 25 to select the block B [1] (1, 1) existing on the outer periphery from the plurality of blocks obtained by the division processing in S103, and sets it as a template.
  • the template setting unit 25 sets a template for each of the target image Img [1], the low-pass images Img [2], and Img [3]. That is, in this modification, the template setting unit 25 sets one block as the template T [1] ⁇ 1 ⁇ .
  • Step S105 The CPU 14 performs matching processing on each of the target image Img [1], the low-pass images Img [2], and Img [3] by the matching processing unit 26.
  • the matching processing unit 26 blocks each block (block B [1] (1,1), B [1] (2,2) to block B [) divided in step S103 for the target image Img [1]. 1]
  • the above-mentioned second representative color feature amount is obtained for (9, 9)).
  • the block (template T [1] ⁇ 1 ⁇ ) corresponding to the template set in step S104 the above-described second representative color feature quantity Q [1] ⁇ 1 ⁇ is obtained, and the target image Img [1] is obtained.
  • a color feature quantity Q [1] (i, j) is obtained.
  • the matching processing unit 26 obtains the representative color feature value CL [1] ⁇ 1 ⁇ and the representative color feature value CL [1] (2,2) to the representative color feature value CL [1] (9,9), respectively.
  • the second representative color feature value Q [1] ⁇ 1 ⁇ and the second representative color feature value Q [1] (2,2) to the second representative color feature value Q [1] (9,9) are obtained.
  • an evaluation value V [1] (i, j) is obtained for each block from the target image Img [1] for each portion excluding the template set in step S104.
  • the matching processing unit 26 performs representative color feature value CL [1] (2,2) and second representative color feature value Q [1] (2,2) of block B [1] (2,2), and step S104. Are compared with the representative color feature value CL [1] ⁇ 1 ⁇ and the second representative color feature value Q [1] ⁇ 1 ⁇ of the template (template T [1] ⁇ 1 ⁇ ) set in step 1, respectively. The value sum V [1] (2,2) ⁇ 1 ⁇ is obtained.
  • the matching processing unit 26 performs the above processing also for the block B [1] (3,2) to the block B [1] , (9,9), and the evaluation value V [1] (3,2) ⁇
  • the evaluation value V [1] (9, 9) is obtained.
  • the value V [1] (i, j) is determined.
  • the matching processing unit 26 performs the same processing for each of the low-pass images Img [2] and Img [3].
  • the evaluation value V [2] (2, 2) ⁇ Evaluation value V [2] (9,9) is obtained, and evaluation value V [3] (2,2) to evaluation value V [3] (9,9) is obtained for the low-pass image Img [3].
  • the target image Img [1] is divided instead of equally divided, and the block B [1] (1,1) which is the only template as a result of the division is defined as the template T [1] ⁇ 1 ⁇ . It is good also as a structure to set. In this case, the same effect as that of the sixth embodiment can be obtained.
  • division example shown in FIG. 11 and the template setting example shown in FIG. 12 are examples, and the present invention is not limited to this example.
  • the division may be performed in any shape, and a template may be set based on a plurality of block images.
  • the seventh embodiment is a modification of map creation in the first to sixth embodiments. Therefore, in the present specification, in the description of the following embodiments, the redundant description of the configuration of the image processing apparatus that is common to the first to sixth embodiments is omitted.
  • a process for adding a template is performed in the map creation process in the first to sixth embodiments.
  • FIG. 13 is a flowchart showing a modification of the flowchart shown in FIG. 2 of the first embodiment.
  • the CPU 14 performs the same processing as steps S101 to S106 in the flowchart shown in FIG.
  • the CPU 14 determines whether or not there is a template to be added based on the map Sal [T] obtained in step S206. When determining that there is a template to be added, the CPU 14 returns to step S204 and sets the template again. On the other hand, when determining that there is no template to be added, the CPU 14 proceeds to step S208.
  • CPU14 calculates
  • the representative value may be obtained by any method such as an average value or a median value. Then, if there is a block whose calculated representative value is smaller than a predetermined threshold, it is determined that there is a template to be added.
  • a block whose representative value is smaller than a predetermined threshold is a block that can be assumed to be a background area. Therefore, a map with higher accuracy can be created by adding such a block as a template.
  • CPU14 repeats the process of step S204 to step S207 until it determines with there being no template to add.
  • adding a template is useful when the background of the target image has a gradation.
  • a gradation is applied in which the color becomes lighter (or lighter) from the outside to the inside of the background portion, the block closer to the center is more likely to be different from the block existing in the outer peripheral portion. Therefore, since these blocks have large map values, there is a high possibility that these blocks will be detected as main subject areas.
  • adjacent blocks with little difference are gradually added as a template, so that a block existing in a portion that is a background region can be reliably set as a template.
  • a map with higher accuracy can be created by adding a template.
  • FIG. 14 is a block diagram illustrating a configuration example of an electronic camera according to the eighth embodiment.
  • the electronic camera 31 includes an imaging optical system 32, an imaging device 33, an image processing engine 34, a ROM 35, a main memory 36, a recording I / F 37, an operation unit 38 that receives user operations, and a monitor (not shown). It has the display part 39 provided with.
  • the image sensor 33, ROM 35, main memory 36, recording I / F 37, operation unit 38 and display unit 39 are each connected to the image processing engine 34.
  • the imaging element 33 is an imaging device that captures an image of a subject formed by the imaging optical system 32 and generates an image signal of the captured image.
  • the image signal output from the image sensor 33 is input to the control unit via an A / D conversion circuit (not shown).
  • the image processing engine 34 is a processor that comprehensively controls the operation of the electronic camera 31.
  • the image processing engine 34 performs various types of image processing (color interpolation processing, gradation conversion processing, contour enhancement processing, white balance adjustment, color conversion processing, etc.) on the captured image data.
  • the image processing engine 34 is configured to execute any one of the image processing apparatuses (the CPU 14, the low-pass image generation unit 23, the region division unit 24, the template setting unit 25, and the like) according to the first to seventh embodiments by executing a program. It functions as a matching processing unit 26 and a map creation unit 27).
  • the ROM 35 stores a program executed by the image processing engine 34.
  • the main memory 36 temporarily stores image data in the pre-process and post-process of image processing.
  • the recording I / F 37 has a connector for connecting the nonvolatile storage medium 40. Then, the recording I / F 37 executes data writing / reading with respect to the storage medium 40 connected to the connector.
  • the storage medium 40 is composed of a hard disk, a memory card incorporating a semiconductor memory, or the like. In FIG. 14, a memory card is illustrated as an example of the storage medium 40.
  • the display unit 39 displays the image data acquired from the image processing engine 34 and the display described in step S108 of the first embodiment.
  • the electronic camera 31 of the eighth embodiment acquires an image captured by the image sensor 33 as a target image in an imaging process triggered by a user's imaging instruction, and is the same as the image processing apparatus of any of the above embodiments.
  • a map Sal [T] is created by processing.
  • the image processing engine 34 may record the map Sal [T] as supplementary information in an image file including data of the target image. Further, the same processing may be performed using an image recorded in the main memory 36 or the like as a target image.
  • the electronic camera 31 of the eighth embodiment can obtain substantially the same effect as that of the above embodiment.
  • each variable, coefficient, threshold value, and the like described in the above embodiments is an example, and the present invention is not limited to this example.
  • the block division in step S103 of the first embodiment is an example of 10 ⁇ 10, but other division numbers may be used.
  • the block division in step S103 of the first embodiment has been described so as not to generate an overlapping portion in a 10 ⁇ 10 region, but the division may be performed so as to have an overlapping portion. If the overlapping portion does not occur, the accuracy of the map may be lowered if the main subject region exists across a plurality of blocks. Therefore, by performing the division including the overlapping portion, it can be expected that the accuracy of the map is improved even when the main subject region exists over a plurality of blocks. Furthermore, block division may be performed by excluding a part of the region from the beginning by regarding the central portion as the main subject region.
  • the map Sal [T] shown in FIG. 15B can be created by performing the processing described in the above embodiments on the target image Img [1] shown in FIG. 15A.
  • a main subject area is extracted based on the created map Sal [T]
  • a plurality of main subject areas can be extracted from the map Sal [T] as shown in FIG. 16A.
  • a plurality of main subject areas can be extracted from the target image Img [1].
  • the plurality of main subject areas can be recognized separately by using a known labeling technique or grouping processing by clustering.
  • any one of a plurality of main subject areas for example, a method of selecting a main subject area having a large area, or a main subject area having a high sum of map values corresponding to pixels constituting the main subject area.
  • the method of selecting can be considered.
  • the possibility of deleting a portion corresponding to noise increases.
  • any one of a plurality of main subject areas may be selected based on a user operation.
  • zooming to the selected main subject area is performed during the automatic zooming to the main subject area shown in (a) of the first embodiment. Done. Further, in the use for AF, AE, AWB shown in (b) of the first embodiment, AF, AE, AWB control and automatic shutter control corresponding to the selected main subject area are performed. In particular, in automatic shutter control, if information of a plurality of main subject areas is combined and the whole is regarded as one main subject area, AF control is performed on a portion not included in any main subject area. There is a risk of going.
  • the center of the selected main subject area is determined as the zoom center.
  • automatic cropping is performed on the selected main subject area.
  • the image processing apparatus of the present invention is not limited to the example of the personal computer of the above embodiment.
  • the image processing apparatus of the present invention may be an electronic device (for example, a photo viewer, a digital photo frame, a photo printing apparatus, etc.) having a digital image reproduction display function and a retouch function.
  • the imaging device of the present invention may be mounted as a camera module of a mobile phone terminal.
  • the matching processing method of the above embodiment is an example, and the present invention is not limited to this example.
  • a matching process may be performed using normalized correlation in order to be robust against illumination changes.
  • the matching process may be performed using various image feature amounts (Edge Histgram or Scalable Color) defined by Mpeg-7.
  • EMD Earth Move Distance
  • each process of the low-pass image generation unit 23, the region division unit 24, the template setting unit 25, the matching processing unit 26, and the map creation unit 27 is realized by software.
  • each of these processes may be realized by hardware using an ASIC.

Abstract

The disclosed image processing device is provided with an acquisition unit for acquiring information of an object image to be an object of processing; a region partitioning unit for partitioning the object image into a plurality of blocks; a setting unit for setting one or more templates on the basis of images of one or more blocks existing on an outer peripheral portion of the object image among the plurality of blocks; a calculation unit for calculating a representative value for each of the plurality of blocks into which the object image has been partitioned; a matching unit for performing matching for each of the plurality of blocks by comparing a representative value of a block to be matched with representative values in the one or more templates; and a creation unit for creating maps indicating distribution of a subject in the object image on the basis of the results of the matching by the matching unit; whereby extraction of a main subject region is performed by a method compatible with the object image without depending on high frequency components or assuming an empirical composition.

Description

画像処理装置、撮像装置、および画像処理プログラムImage processing apparatus, imaging apparatus, and image processing program
 本発明は、画像処理装置、撮像装置、および画像処理プログラムに関する。 The present invention relates to an image processing device, an imaging device, and an image processing program.
 従来から、被写界に含まれる主要被写体領域を抽出する技術が種々提案されている。一例として、特許文献1には、画像のある部分の特徴と、その部分の周囲に位置する部分の特徴とが異なる度合いを求めて、主要被写体領域を抽出する技術が開示されている。 Conventionally, various techniques for extracting a main subject area included in a scene have been proposed. As an example, Patent Document 1 discloses a technique for obtaining a main subject region by obtaining a degree of difference between a feature of a certain part of an image and a feature of a part located around the part.
特開2009-246920号公報JP 2009-246920 A
 しかし、従来の技術は、高周波成分に依存して主要被写体領域を抽出している。そのため、主要被写体領域以外の部分(背景領域)に高周波成分が含まれる場合には、この部分も主要被写体領域として抽出されてしまい、好ましい結果が得られない。さらに、経験的に想定される構図に基づいて、主要被写体領域の抽出を行う技術も考えられている。例えば、中央部分に主要被写体が存在すると想定し、画像の中央の部分を重視して抽出を行ったり、「縦横それぞれ1/3の線上に背景線を置くか、この線の交点上に被写体を置くとバランスの良い構図となる」という三分割法(1/3ルール)にしたがって抽出を行ったりしている。このような技術においては、想定された構図以外の構図の画像においては、好ましい抽出が行われない場合があるという問題がある。 However, the conventional technique extracts the main subject area depending on the high frequency component. Therefore, when a portion other than the main subject region (background region) contains a high-frequency component, this portion is also extracted as the main subject region, and a preferable result cannot be obtained. Furthermore, a technique for extracting a main subject region based on an empirically assumed composition is also considered. For example, assuming that there is a main subject in the central part, the extraction is performed with emphasis on the central part of the image, or “a background line is placed on 1/3 vertical and horizontal lines or the subject is placed at the intersection of these lines. Extraction is performed according to the three-division method (1/3 rule) that “the composition will be balanced if placed.” In such a technique, there is a problem that preferable extraction may not be performed in an image having a composition other than the assumed composition.
 そこで、本発明の目的は、高周波成分に依存したり、経験的な構図の想定を行ったりすることなく、対象画像に適合した方法で、主要被写体領域の抽出を行うための手段を提供することにある。 Therefore, an object of the present invention is to provide a means for extracting a main subject region by a method suitable for a target image without depending on a high frequency component or assuming an empirical composition. It is in.
 一の態様の画像処理装置は、処理の対象となる対象画像の情報を取得する取得部と、前記対象画像を複数のブロックに分割する領域分割部と、前記複数のブロックのうち、前記対象画像の外周部に存在する1つ以上のブロックの画像に基づいて、1つ以上のテンプレートを設定する設定部と、前記対象画像を分割した前記複数のブロックの各々について代表値を算出する算出部と、マッチング対象のブロックの前記代表値と、前記1つ以上のテンプレートにおける前記代表値とをそれぞれ比較することによるマッチングを、前記複数のブロックごとに行うマッチング部と、前記マッチング部によるマッチングの結果に基づいて、前記対象画像における被写体の分布を示すマップを作成する作成部とを備える。 An image processing apparatus according to an aspect includes an acquisition unit that acquires information on a target image to be processed, an area division unit that divides the target image into a plurality of blocks, and the target image among the plurality of blocks. A setting unit that sets one or more templates based on an image of one or more blocks existing in the outer periphery of the image, and a calculation unit that calculates a representative value for each of the plurality of blocks obtained by dividing the target image The matching unit that performs the matching by comparing the representative value of the block to be matched with the representative value in the one or more templates for each of the plurality of blocks, and the matching result by the matching unit And a creation unit that creates a map indicating the distribution of the subject in the target image.
 なお、前記対象画像よりも低解像度の画像を少なくとも1つ生成する生成部をさらに備え、前記領域分割部は、前記対象画像および前記低解像度の画像を、それぞれ複数のブロックに分割し、前記設定部は、前記対象画像および前記低解像度の画像のそれぞれについて、前記1つ以上のテンプレートを設定し、前記マッチング部は、前記対象画像および前記低解像度の画像のそれぞれについて、前記マッチングを行い、前記作成部は、前記対象画像および前記低解像度の画像のそれぞれについて、被写体の分布を示すマップを作成し、作成した複数のマップに基づく演算を行うことにより、前記対象画像における被写体の分布を示す前記マップを作成しても良い。 The image processing apparatus further includes a generation unit that generates at least one image having a lower resolution than the target image, and the region dividing unit divides the target image and the low resolution image into a plurality of blocks, respectively, and sets the setting. The unit sets the one or more templates for each of the target image and the low resolution image, and the matching unit performs the matching for each of the target image and the low resolution image, and The creation unit creates a map showing the distribution of the subject for each of the target image and the low-resolution image, and performs the calculation based on the plurality of created maps to thereby show the distribution of the subject in the target image. You may create a map.
 また、前記生成部は、前記対象画像に対して、特定の周波数帯域を抑制または透過する処理を施すことにより、前記低解像度の画像を少なくとも1つ生成しても良い。 Further, the generation unit may generate at least one low-resolution image by performing a process of suppressing or transmitting a specific frequency band on the target image.
 また、前記生成部は、前記対象画像に対して、ローパス処理とリサイズ処理との少なくとも一方を施すことにより、前記低解像度の画像を少なくとも1つ生成しても良い。 In addition, the generation unit may generate at least one low-resolution image by performing at least one of low-pass processing and resizing processing on the target image.
 また、前記生成部は、前記対象画像に対して、バンドパスフィルタ処理を施すことにより、前記低解像度の画像を少なくとも1つ生成しても良い。 In addition, the generation unit may generate at least one low-resolution image by performing a band pass filter process on the target image.
 また、前記設定部は、前記対象画像の外周に存在するすべてのブロックの画像に基づいて、前記1つ以上のテンプレートを設定しても良い。 In addition, the setting unit may set the one or more templates based on images of all blocks existing on the outer periphery of the target image.
 また、前記設定部は、前記対象画像のうち、下辺を除く3辺に存在するすべてのブロックの画像に基づいて、前記1つ以上のテンプレートを設定するか、または、前記3辺に存在するすべてのブロックの画像と、前記下辺に存在する予め定められた一部のブロックの画像とに基づいて、前記1つ以上のテンプレートを設定するか、または、左辺および右辺に存在するすべてのブロックの画像に基づいて、前記1つ以上のテンプレートを設定しても良い。 In addition, the setting unit sets the one or more templates based on images of all blocks existing on three sides except the lower side of the target image, or sets all the existing images on the three sides. The one or more templates are set based on the image of the block and the image of some predetermined blocks existing on the lower side, or the images of all the blocks existing on the left side and the right side The one or more templates may be set based on
 また、前記取得部は、前記対象画像の撮像時における撮像装置の姿勢情報をさらに取得し、前記設定部は、前記姿勢情報に基づいて、前記複数のブロックから1つ以上のブロックを選択し、選択したブロックの画像に基づいて、前記1つ以上のテンプレートを設定しても良い。 Further, the acquisition unit further acquires posture information of the imaging device at the time of capturing the target image, and the setting unit selects one or more blocks from the plurality of blocks based on the posture information, The one or more templates may be set based on an image of the selected block.
 また、前記設定部は、前記マッチング対象のブロックの、前記対象画像内における位置に基づいて、前記対象画像の外周に存在するすべてのブロックから、一部のブロックを選択し、選択した複数のブロックの画像に基づいて前記1つ以上のテンプレートを設定しても良い。 In addition, the setting unit selects some blocks from all the blocks existing on the outer periphery of the target image based on the position of the matching target block in the target image, and selects a plurality of selected blocks The one or more templates may be set based on the image.
 また、前記算出部は、前記代表値として、ブロック内に含まれる画素ごとの画素値を算出し、前記マッチング部は、マッチング対象のブロック内の任意の画素の画素値間の差分に基づいて、前記マッチング対象のブロックに関する評価値としても良い。 Further, the calculating unit calculates a pixel value for each pixel included in the block as the representative value, and the matching unit is based on a difference between pixel values of arbitrary pixels in the matching target block, An evaluation value related to the matching target block may be used.
 また、前記算出部は、前記代表値として、ブロック内に含まれる画素ごとの画素値を算出し、前記マッチング部は、マッチング対象のブロック内の任意の画素の画素値と、任意のテンプレートのブロック内において、前記任意の画素に対応する位置の画素の画素値との差分の絶対値を、前記マッチング対象のブロック内のすべての画素について求めて加算した値である差分絶対値総和を、前記1つ以上のテンプレートのそれぞれについて求め、求めた複数の前記差分絶対値総和のうち、最小の前記差分絶対値総和の値を、前記マッチング対象のブロックに関する前記評価値としても良い。 Further, the calculation unit calculates a pixel value for each pixel included in the block as the representative value, and the matching unit calculates a pixel value of an arbitrary pixel in the block to be matched and an arbitrary template block The difference absolute value sum, which is a value obtained by obtaining and adding the absolute value of the difference from the pixel value of the pixel at the position corresponding to the arbitrary pixel for all the pixels in the matching target block, Each of the two or more templates may be obtained, and a minimum value of the difference absolute value sum among the obtained plurality of difference absolute value sums may be used as the evaluation value for the block to be matched.
 また、前記算出部は、ブロック内に含まれる画素ごとの画素値を算出した後に、ブロック内に含まれる前記画素値に対して周波数領域への画像変換を行うことにより前記代表値を算出し、前記マッチング部は、マッチング対象のブロック内の任意の代表値と、任意のテンプレートのブロック内において、前記任意の代表値に対応する代表値との差分の絶対値を、前記マッチング対象のブロック内のすべての画素に対応する代表値について求めて加算した値である差分絶対値総和を、前記1つ以上のテンプレートのそれぞれについて求め、求めた複数の前記差分絶対値総和のうち、最小の前記差分絶対値総和の値を、前記マッチング対象のブロックに関する前記評価値としても良い。 In addition, the calculation unit calculates the representative value by calculating a pixel value for each pixel included in the block, and then performing image conversion to a frequency domain on the pixel value included in the block, The matching unit calculates an absolute value of a difference between an arbitrary representative value in a matching target block and a representative value corresponding to the arbitrary representative value in an arbitrary template block in the matching target block. A sum of absolute differences, which is a value obtained by obtaining and adding representative values corresponding to all pixels, is obtained for each of the one or more templates, and the smallest absolute difference among the plurality of obtained sums of absolute differences. The value sum value may be used as the evaluation value for the matching target block.
 また、前記算出部は、ブロック内に含まれる前記画素値に対して、クラスタリングなどで複数の代表色とその重みを算出し、EMD(Earth Mover Distance)などの代表色とその重みを考慮した距離を計算しても良い。その際には、ブロックごとの代表色数は異なっていても良い。 Further, the calculation unit calculates a plurality of representative colors and their weights by clustering or the like for the pixel values included in the block, and considers the representative colors such as EMD (Earth Move Distance) and the weights thereof. May be calculated. In that case, the number of representative colors for each block may be different.
 また、前記算出部は、ブロック内に含まれる前記画素値に対して、フーリエ変換と、離散コサイン変換と、ウェーブレット変換との少なくとも1つを行うことにより前記代表値を算出しても良い。 In addition, the calculation unit may calculate the representative value by performing at least one of Fourier transform, discrete cosine transform, and wavelet transform on the pixel value included in the block.
 また、前記算出部は、前記代表値として、前記対象画像を構成する複数の色成分の分布に基づいて、色に関する特徴を示す値を、前記複数のブロックごとに算出し、前記マッチング部は、マッチング対象のブロックの代表値と、任意のテンプレートのブロックの代表値との差分を加算した値である差分絶対値総和を、前記1つ以上のテンプレートのそれぞれについて求め、求めた複数の前記差分絶対値総和のうち、最小の前記差分絶対値総和の値と、最大の前記差分絶対値総和の値と、前記差分絶対値総和の平均値との少なくとも1つを、前記マッチング対象のブロックに関する前記評価値としても良い。 In addition, the calculation unit calculates, as the representative value, a value indicating a color feature for each of the plurality of blocks based on a distribution of a plurality of color components constituting the target image, and the matching unit includes: A sum of absolute differences, which is a value obtained by adding a difference between a representative value of a matching target block and a representative value of a block of an arbitrary template, is obtained for each of the one or more templates, and the plurality of obtained absolute differences Among the value sums, at least one of the minimum value of the difference absolute value sum, the value of the maximum difference absolute value sum, and the average value of the sum of difference absolute values is the evaluation related to the block to be matched. It is good as a value.
 また、前記算出部は、前記代表値として、ヒストグラムに基づく代表色を示す値と、相対ヒストグラムに基づく特徴量を示す値との少なくとも一方を算出しても良い。 In addition, the calculation unit may calculate at least one of a value indicating a representative color based on a histogram and a value indicating a feature amount based on a relative histogram as the representative value.
 また、前記作成部は、前記評価値と、前記評価値の取り得る値の範囲に応じて定められた閾値とを比較し、比較結果に基づいて前記マップを作成しても良い。 Further, the creation unit may compare the evaluation value with a threshold value determined according to a range of values that the evaluation value can take, and create the map based on the comparison result.
 また、前記領域分割部により分割された前記複数のブロックのうち、前記設定部により前記テンプレートに設定されていないブロックについて、前記作成部により作成した前記マップにおける値と所定の閾値とを比較し、比較結果に基づいて、1つ以上のテンプレートを新たに追加する追加設定部をさらに備え、前記マッチング部は、マッチング対象のブロックの前記代表値と、前記追加設定部により追加された前記1つ以上のテンプレートにおける前記代表値とをそれぞれ比較することによるマッチングを、前記複数のブロックごとに行い、前記作成部は、前記マッチング部によるマッチングの結果に基づいて、前記対象画像における被写体の分布を示すマップを作成しても良い。 Further, among the plurality of blocks divided by the region dividing unit, for a block not set in the template by the setting unit, the value in the map created by the creating unit is compared with a predetermined threshold value, Based on the comparison result, an additional setting unit that newly adds one or more templates is further provided, and the matching unit includes the representative value of the block to be matched and the one or more added by the additional setting unit. Matching is performed for each of the plurality of blocks by comparing each of the representative values in the template, and the creation unit is a map showing the distribution of subjects in the target image based on the result of matching by the matching unit May be created.
 また、前記対象画像に複数の被写体画像が含まれる場合に、前記作成部により作成した前記マップに対して、ラベリング処理と、クラスタリングによるグループ化処理との少なくとも一方を行うことにより前記複数の被写体を識別可能にする処理を行う処理部をさらに備えても良い。 In addition, when the target image includes a plurality of subject images, the map created by the creation unit is subjected to at least one of a labeling process and a grouping process by clustering, so that the plurality of subjects are detected. You may further provide the process part which performs the process which makes identification possible.
 また、前記表示部は、前記対象画像を表示する際に、前記マップにおける値が所定の閾値を超える領域に対応する前記対象画像上の領域を、視認可能に表示しても良い。 In addition, when the target image is displayed, the display unit may display a region on the target image corresponding to a region where a value in the map exceeds a predetermined threshold value so as to be visible.
 また、前記対象画像に対して、前記マップにおける値が所定の閾値を超える領域に対応する前記対象画像上の領域をトリミング処理する画像処理部をさらに備えても良い。 Further, an image processing unit may be further provided that performs a trimming process on an area on the target image corresponding to an area where a value in the map exceeds a predetermined threshold with respect to the target image.
 一の態様の撮像装置は、被写体の像を撮像する撮像部と、上述したいずれかの画像処理装置とを備え、前記取得部は、前記撮像部から前記対象画像の情報を取得する。 An imaging apparatus according to one aspect includes an imaging unit that captures an image of a subject and any of the image processing apparatuses described above, and the acquisition unit acquires information on the target image from the imaging unit.
 なお、前記対象画像に対して、前記マップにおける値が所定の閾値を超える領域に対応する前記対象画像上の領域をトリミング処理する画像処理部をさらに備えても良い。 It should be noted that an image processing unit may be further provided for the target image to perform a trimming process on a region on the target image corresponding to a region whose value in the map exceeds a predetermined threshold.
 また、前記マップに基づいて、前記撮像部による撮像時における焦点調節制御と露出制御との少なくとも一方を行う制御部をさらに備えても良い。 Further, a control unit that performs at least one of focus adjustment control and exposure control during imaging by the imaging unit based on the map may be further provided.
 また、前記マップに基づいて、主要被写体の大きさと位置との少なくとも一方を監視し、監視結果に応じて、前記撮像部による撮像を開始する制御部をさらに備えても良い。 Further, it may further include a control unit that monitors at least one of the size and the position of the main subject based on the map and starts imaging by the imaging unit according to the monitoring result.
 また、前記撮像部は、光学ズーム機能と電子ズーム機能との少なくとも一方を有し、前記マップに基づいて、前記撮像部による前記光学ズーム機能と前記電子ズーム機能との少なくとも一方を実行しても良い。 The imaging unit has at least one of an optical zoom function and an electronic zoom function, and executes at least one of the optical zoom function and the electronic zoom function by the imaging unit based on the map. good.
 なお、コンピュータを一の態様の画像処理装置として動作させるプログラムや、このプログラムを記憶した記憶媒体や、一の態様に係る画像処理装置の動作を方法のカテゴリで表現したものも、本発明の具体的態様として有効である。 Note that a program that causes a computer to operate as an image processing apparatus according to an aspect, a storage medium that stores the program, and an operation of the image processing apparatus according to an aspect expressed in a method category are also specific examples of the present invention. It is effective as a specific embodiment.
第1実施形態での画像処理装置の構成例を示すブロック図1 is a block diagram illustrating a configuration example of an image processing apparatus according to a first embodiment. 第1実施形態での画像処理装置の動作例を示す流れ図A flow chart showing an example of operation of an image processing device in a 1st embodiment. 第1実施形態での画像処理装置の動作例を示す別の流れ図Another flowchart which shows the operation example of the image processing apparatus in 1st Embodiment. 第1実施形態でのブロック分割の例を示す図The figure which shows the example of the block division | segmentation in 1st Embodiment 第1実施形態でのテンプレートの設定例を示す図The figure which shows the example of a template setting in 1st Embodiment 第1実施形態でのマップSal[T]の例を示す図The figure which shows the example of map Sal [T] in 1st Embodiment. 第1実施形態での主要被写体領域の抽出の例を示す図The figure which shows the example of extraction of the main subject area | region in 1st Embodiment. 第1実施形態での自動クロップの例を示す図The figure which shows the example of the automatic crop in 1st Embodiment 第3実施形態でのテンプレートの設定例を示す図The figure which shows the example of a template setting in 3rd Embodiment 第4実施形態でのテンプレートの設定例を示す図The figure which shows the example of a template setting in 4th Embodiment 第6実施形態の変形例でのブロック分割の例を示す図The figure which shows the example of the block division | segmentation in the modification of 6th Embodiment 第6実施形態の変形例でのテンプレートの設定例を示す図The figure which shows the example of a template setting in the modification of 6th Embodiment. 第7実施形態での画像処理装置の動作例を示す流れ図Flowchart showing an example of operation of the image processing apparatus in the seventh embodiment 第8実施形態での電子カメラの構成例を示すブロック図The block diagram which shows the structural example of the electronic camera in 8th Embodiment. 別のマップSal[T]の例を示す図The figure which shows the example of another map Sal [T] 複数の主要被写体領域の抽出の例を示す図The figure which shows the example of extraction of several main subject area | regions
 <第1実施形態の説明>
 図1は、第1実施形態での画像処理装置の構成例を示すブロック図である。第1実施形態の画像処理装置は、撮像装置により撮像された処理対象の画像(対象画像)について、被写体の分布を示すマップを作成する画像処理プログラムがインストールされたパーソナルコンピュータで構成される。
<Description of First Embodiment>
FIG. 1 is a block diagram illustrating a configuration example of an image processing apparatus according to the first embodiment. The image processing apparatus according to the first embodiment is configured by a personal computer in which an image processing program for creating a map indicating the distribution of a subject is installed with respect to a processing target image (target image) captured by the imaging apparatus.
 図1に示すコンピュータ11は、データ読込部12、記憶装置13、CPU14、メモリ15および入出力I/F16、バス17を有している。データ読込部12、記憶装置13、CPU14、メモリ15および入出力I/F16は、バス17を介して相互に接続されている。さらに、コンピュータ11には、入出力I/F16を介して、入力デバイス18(キーボード、ポインティングデバイスなど)とモニタ19とがそれぞれ接続されている。なお、入出力I/F16は、入力デバイス18からの各種入力を受け付けるとともに、モニタ19に対して表示用のデータを出力する。 1 includes a data reading unit 12, a storage device 13, a CPU 14, a memory 15, an input / output I / F 16, and a bus 17. The data reading unit 12, the storage device 13, the CPU 14, the memory 15, and the input / output I / F 16 are connected to each other via a bus 17. Further, an input device 18 (keyboard, pointing device, etc.) and a monitor 19 are connected to the computer 11 via an input / output I / F 16. The input / output I / F 16 receives various inputs from the input device 18 and outputs display data to the monitor 19.
 データ読込部12は、上記の対象画像のデータや、上記の画像処理プログラムを外部から読み込むときに用いられる。例えば、データ読込部12は、着脱可能な記憶媒体からデータを取得する読込デバイス(光ディスク、磁気ディスク、光磁気ディスクの読込装置など)や、公知の通信規格に準拠して外部の装置と通信を行う通信デバイス(USBインターフェース、LANモジュール、無線LANモジュールなど)で構成される。 The data reading unit 12 is used when reading the target image data and the image processing program from the outside. For example, the data reading unit 12 communicates with a reading device (such as an optical disk, a magnetic disk, or a magneto-optical disk reading device) that acquires data from a removable storage medium, or an external device in accordance with a known communication standard. It consists of communication devices (USB interface, LAN module, wireless LAN module, etc.) to be performed.
 記憶装置13は、例えば、ハードディスクや、不揮発性の半導体メモリなどの記憶媒体で構成される。記憶装置13は、画像を記録する画像蓄積部21と後述するマップを記録するマップ蓄積部22とを備える。この記憶装置13には、画像処理プログラムや、プログラムの実行に必要となる各種のデータが記録されている。なお、記憶装置13には、データ読込部12から読み込んだ対象画像のデータを記憶しておくこともできる。 The storage device 13 is constituted by a storage medium such as a hard disk or a nonvolatile semiconductor memory, for example. The storage device 13 includes an image storage unit 21 that records an image and a map storage unit 22 that records a map to be described later. The storage device 13 stores an image processing program and various data necessary for executing the program. The storage device 13 can also store the data of the target image read from the data reading unit 12.
 CPU14は、コンピュータ11の各部を統括的に制御するプロセッサである。このCPU14は、上記の画像処理プログラムの実行によって、ローパス画像生成部23と、領域分割部24と、テンプレート設定部25と、マッチング処理部26と、マップ作成部27としてそれぞれ機能する(ローパス画像生成部23、領域分割部24、テンプレート設定部25、マッチング処理部26、マップ作成部27の各動作は後述する)。 The CPU 14 is a processor that comprehensively controls each part of the computer 11. The CPU 14 functions as a low-pass image generation unit 23, a region division unit 24, a template setting unit 25, a matching processing unit 26, and a map creation unit 27 by executing the above-described image processing program (low-pass image generation). The operations of the unit 23, the region dividing unit 24, the template setting unit 25, the matching processing unit 26, and the map creating unit 27 will be described later).
 メモリ15は、画像処理プログラムでの各種演算結果(変数およびフラグの値など)を一時的に記憶する。このメモリ15は、例えば揮発性のSDRAMなどで構成される。 The memory 15 temporarily stores various calculation results (such as variables and flag values) in the image processing program. The memory 15 is composed of, for example, a volatile SDRAM.
 <第1実施形態の動作例>
 以下、図2および図3の流れ図を参照しつつ、第1実施形態における画像処理装置の動作例を説明する。なお、図2および図3の流れ図の処理は、ユーザによるプログラム実行指示に応じて、CPU14が画像処理プログラムを実行することで開始される。また、図2および図3の図中のステップ番号はそれぞれ対応している。
<Operation Example of First Embodiment>
Hereinafter, an operation example of the image processing apparatus according to the first embodiment will be described with reference to the flowcharts of FIGS. 2 and 3. 2 and 3 is started when the CPU 14 executes the image processing program in response to a program execution instruction from the user. Further, the step numbers in FIGS. 2 and 3 correspond to each other.
 (ステップS101)
 CPU14は、データ読込部12を介して、ユーザにより指定された対象画像のデータを外部から取得する。なお、対象画像のデータが予め記憶装置13の画像蓄積部21などに記憶されている場合には、CPU14はS101の処理を省略してもよい。以下、本明細書の例では、取得した対象画像をImg[1]と表記する。
(Step S101)
The CPU 14 obtains data of the target image designated by the user from the outside via the data reading unit 12. Note that when the target image data is stored in advance in the image storage unit 21 of the storage device 13 or the like, the CPU 14 may omit the process of S101. Hereinafter, in the example of the present specification, the acquired target image is denoted as Img [1].
 (ステップS102)
 CPU14は、ローパス画像生成部23により、ステップS101で取得した対象画像Img[1]の画像の画像データに基づいて、ローパス画像Img[2]およびImg[3]を生成する。ローパス画像Img[2]の生成は、以下の式1および式2により行われ、ローパス画像Img[3]の生成は、以下の式3および式4により行われる。
(Step S102)
The CPU 14 causes the low-pass image generation unit 23 to generate the low-pass images Img [2] and Img [3] based on the image data of the target image Img [1] acquired in step S101. The generation of the low-pass image Img [2] is performed by the following equations 1 and 2, and the generation of the low-pass image Img [3] is performed by the following equations 3 and 4.
Figure JPOXMLDOC01-appb-M000001
Figure JPOXMLDOC01-appb-M000001
 まず、式1を用いて、対象画像Img[1]のデータを、フーリエ変換により、周波数領域における表現に直交変換する。式1中の(ωx,ωy)は、周波数空間における座標を示し、fq1は、所定の閾値を示す(fqの詳細は後述する)。次に、式2を用いて、式1により求められたF(LImg[2])に対して逆フーリエ変換を行って、帯域制限が施されたローパス画像Img[2]を生成する。 First, using Equation 1, the data of the target image Img [1] is orthogonally transformed into an expression in the frequency domain by Fourier transformation. (Ωx, ωy) in Equation 1 indicates coordinates in the frequency space, and fq1 indicates a predetermined threshold (details of fq will be described later). Next, using Expression 2, an inverse Fourier transform is performed on F (LImg [2]) obtained by Expression 1 to generate a low-pass image Img [2] subjected to band limitation.
 ローパス画像Img[3]についても、同様に、式3および式4を用いて、対象画像Img[1]のデータに対してフーリエ変換と逆フーリエ変換を行ってローパス画像Img[3]を生成する。 Similarly, with respect to the low-pass image Img [3], the low-pass image Img [3] is generated by performing Fourier transform and inverse Fourier transform on the data of the target image Img [1] using Equation 3 and Equation 4. .
 なお、式1中のfq1および式3中のfq2は、対象画像の高さ、幅、対角線などを基準に予め定められる閾値である。fq1およびfq2は、同じ値であっても良いし、違う値であっても良い。また、上述の例では、対象画像Img[1]の画像データに基づいて、ローパス画像Img[2]およびImg[3]を生成する例を示したが、対象画像Img[1]の画像データに基づいて、ローパス画像Img[2]を生成し、生成したローパス画像Img[2] の画像データに基づいて、ローパス画像Img[3]を生成しても良い。 Note that fq1 in Expression 1 and fq2 in Expression 3 are threshold values that are determined in advance based on the height, width, diagonal line, and the like of the target image. fq1 and fq2 may be the same value or different values. In the above example, the low-pass images Img [2] and Img [3] are generated based on the image data of the target image Img [1]. However, the image data of the target image Img [1] Based on this, the low-pass image Img [2] may be generated, and the low-pass image Img [3] may be generated based on the image data of the generated low-pass image Img [2].
 また、上述の例ではローパス処理を行うことにより、対象画像Img[1]より低解像度の画像であるローパス画像Img[2] およびImg[3]を生成する例を示したが、対象画像Img[1]に対して、特定の周波数帯域を抑制または透過する処理を施すことにより、同様の画像を作成することができる。例えば、以下の式5および上述した式2を用いて、対象画像Img[1]に対してバンドパスフィルタ処理を施しても良い。 In the above example, low-pass processing is performed to generate low-pass images Img [2] 2 and Img [3], which are lower resolution images than the target image Img [1]. A similar image can be created by applying processing for suppressing or transmitting a specific frequency band to 1]. For example, bandpass filter processing may be performed on the target image Img [1] using the following Expression 5 and Expression 2 described above.
Figure JPOXMLDOC01-appb-M000002
Figure JPOXMLDOC01-appb-M000002
 式5は、周波数領域におけるバンドパスフィルタを示す。式5を用いて、対象画像Img[1]のデータを、フーリエ変換により、周波数領域における表現に直交変換する。式5中の(ωx,ωy)は、周波数空間における座標を示し、fq3およびfq4は、所定の閾値を示す。このfq3およびfq4は、上述したfq1およびfq2と同様に、対象画像の高さ、幅、対角線などを基準に予め定められる閾値である。fq3およびfq4の何れかは、fq1およびfq2と同じ値であっても良いし、違う値であっても良い。次に、上述した式2を用いて、式5により求められたF(BImg[2])に対して逆フーリエ変換を行って、帯域制限が施されたバンドパス画像Img[2]を生成する。 Equation 5 represents a bandpass filter in the frequency domain. Using Equation 5, the data of the target image Img [1] is orthogonally transformed into an expression in the frequency domain by Fourier transformation. (Ωx, ωy) in Equation 5 represents coordinates in the frequency space, and fq3 and fq4 represent predetermined threshold values. These fq3 and fq4 are threshold values that are determined in advance based on the height, width, diagonal line, and the like of the target image, similarly to the above-described fq1 and fq2. Any of fq3 and fq4 may be the same value as fq1 and fq2, or may be a different value. Next, inverse Fourier transform is performed on F (BImg [2]) obtained by Equation 5 using Equation 2 described above to generate a bandpass image Img [2] subjected to band limitation. .
 バンドパス画像Img[3]についても、同様である。なお、ローパス処理を行う場合と同様に、対象画像Img[1]の画像データに基づいて、バンドパス画像Img[2]およびImg[3]を生成しても良いし、対象画像Img[1]の画像データに基づいて、バンドパスImg[2]を生成し、生成したバンドパス画像Img[2] の画像データに基づいて、バンドパス画像Img[3]を生成しても良い。 The same applies to the bandpass image Img [3]. As in the case of performing the low-pass process, bandpass images Img [2] and Img [3] may be generated based on the image data of the target image Img [1], or the target image Img [1]. The bandpass Img [2] may be generated based on the image data, and the bandpass image Img [3] may be generated based on the image data of the generated bandpass image Img [2].
 ローパス処理に代えてバンドパスフィルタ処理を用いる場合、例えば、対象画像Img[1]が、背景が夕焼け空等の緩やかなグラデーションのかかった画像である場合などには、後述するマッチング処理が効果的に機能するように、特定の周波数帯域のみを抑圧または透過させるバンドパスフィルタを適用すると良い。 When band-pass filter processing is used instead of low-pass processing, for example, when the target image Img [1] is an image with a gentle gradation such as a sunset sky, matching processing described later is effective. It is preferable to apply a band pass filter that suppresses or transmits only a specific frequency band so as to function.
 (ステップS103)
 CPU14は、領域分割部24により、ステップS101で取得した対象画像Img[1]、ステップS102で生成したローパス画像Img[2]およびImg[3]を、それぞれ、複数のブロックに等間隔に分割する。一例として、第1実施形態での領域分割部24は、対象画像Img[1]、ローパス画像Img[2]およびImg[3]を、それぞれ10×10のマトリクス状にブロックで等分割する。なお、以下では、各ブロックは、[n]で画像の種類を示し、(i,j)でブロックの位置を示し、ブロックB[n] (i,j)と表記する。nは画像の種類を示し、n=1はステップS101で取得した対象画像Img[1]を示し、n=2およびn=3はステップS102で生成したローパス画像Img[2]およびImg[3]を示す。また、iは横方向の位置を示し、jは縦方向の順番を示す。例えば、対象画像Img[1]の左上隅のブロックは始点であり、ブロックB[1] (1,1)と表記され、右下隅のブロックは終点であり、ブロックB[1] (10,10)と表記される。(図4参照)。ローパス画像Img[2]およびImg[3]についても同様である。
(Step S103)
The CPU 14 divides the target image Img [1] acquired in step S101 and the low-pass images Img [2] and Img [3] generated in step S102 into a plurality of blocks at equal intervals by the region dividing unit 24, respectively. . As an example, the region dividing unit 24 in the first embodiment equally divides the target image Img [1], the low-pass images Img [2], and Img [3] into blocks of 10 × 10 each. In the following, each block indicates the type of image with [n], indicates the position of the block with (i, j), and is denoted as block B [n] (i, j). n indicates the type of image, n = 1 indicates the target image Img [1] acquired in step S101, and n = 2 and n = 3 indicate the low-pass images Img [2] and Img [3] generated in step S102. Indicates. Further, i indicates the position in the horizontal direction, and j indicates the order in the vertical direction. For example, the block at the upper left corner of the target image Img [1] is the start point and is expressed as block B [1] (1,1), the block at the lower right corner is the end point, and block B [1] (10, 10 ). (See FIG. 4). The same applies to the low-pass images Img [2] and Img [3].
 なお、ブロック分割の分割数は、処理精度および処理速度の兼ね合いで予め定められる。対象画像Img[1]、ローパス画像Img[2]およびImg[3]の分割数は同じであっても良いし、違っても良い。 Note that the number of block divisions is determined in advance in consideration of processing accuracy and processing speed. The number of divisions of the target image Img [1], the low-pass images Img [2], and Img [3] may be the same or different.
 なお、各画像を分割する際に、画素数と分割数との兼ね合いで余りが生じる場合がある。このような場合には、各画像の最外周部に余りの画素が存在するようにすれば良い。例えば、上下方向に10画素が余った場合には、上辺または下辺の最外周部に10画素の余りを存在させても良いし、上辺と下辺とに分けて(例えば、上辺に5画素、下辺に5画素など)余りの画素を存在させても良い。 Note that when dividing each image, there may be a remainder due to the balance between the number of pixels and the number of divisions. In such a case, it suffices that the extra pixels exist in the outermost periphery of each image. For example, when 10 pixels are left in the up and down direction, a remainder of 10 pixels may be present in the outermost peripheral portion of the upper side or the lower side, or divided into the upper side and the lower side (for example, 5 pixels on the upper side, the lower side (5 pixels, etc.) may be present.
 (ステップS104)
 CPU14は、テンプレート設定部25により、S103の分割処理による複数のブロックから、最外周に存在するブロックを選択し、テンプレートとして設定する。テンプレート設定部25は、テンプレートの設定を対象画像Img[1]、ローパス画像Img[2]およびImg[3]のそれぞれについて行う。
(Step S104)
The CPU 14 uses the template setting unit 25 to select a block existing on the outermost periphery from a plurality of blocks obtained by the division processing in S103 and set it as a template. The template setting unit 25 performs template setting for each of the target image Img [1], the low-pass images Img [2], and Img [3].
 以下では、対象画像Img[1]におけるテンプレートの設定を例に挙げて説明する。テンプレート設定部25は、図5に示すように、対象画像Img[1]の最外周に存在するブロック(図5中、斜線で示したブロック)を選択し、テンプレートとして設定する。すなわち、図4で示した複数のブロックのうち、上辺に存在するブロックB[1] (1,1)~ブロックB[1] (10,1)の10個のブロックと、左辺に存在するブロックB[1] (1,2)~ブロックB[1] (1,9)の8個のブロックと、右辺に存在するブロックB[1] (10,2)~ブロックB[1] (10,9)の8個のブロックと、下辺に存在するブロックB[1] (1,10)~ブロックB[1] (10,10)の10個のブロックとの、合計36個のブロックをテンプレートとして設定する。 Hereinafter, the setting of the template in the target image Img [1] will be described as an example. As shown in FIG. 5, the template setting unit 25 selects a block (a block indicated by hatching in FIG. 5) existing on the outermost periphery of the target image Img [1] and sets it as a template. That is, among the plurality of blocks shown in FIG. 4, 10 blocks from block B [1] (1,1) to block B [1] (10,1) existing on the upper side and blocks existing on the left side B [1] (1,2) to B [1] (1,9), and eight blocks B [1] (10,2) to B [1] (10, 9) 8 blocks and 10 blocks of blocks B [1] (1,10) to B [1] (10,10) existing on the lower side as a template. Set.
 ただし、上述したように、各画像を分割する際に余りが生じた場合には、ステップS104でテンプレートとして設定されるブロックは、「各ブロックのうち、最外周に存在するブロック」となる。 However, as described above, when there is a remainder when each image is divided, the block set as a template in step S104 is “a block that exists on the outermost periphery among the blocks”.
 なお、以下では、左上から右下の方向にテンプレートに番号Nを付し、各テンプレートをテンプレートT[1]{N}と表記する。上述したように、対象画像Img[1]の最外周に存在する36個のブロックが選択されると、図5に示すように、テンプレートT[1]{1}~テンプレートT[1]{36}の36個のテンプレートが設定されることになる。 In the following, the number N is assigned to the template from the upper left to the lower right, and each template is represented as a template T [1] {N}. As described above, when 36 blocks existing on the outermost periphery of the target image Img [1] are selected, as shown in FIG. 5, the templates T [1] {1} to T [1] {36 } Templates are set.
 テンプレート設定部25は、同様の処理をローパス画像Img[2]およびImg[3]のそれぞれについても行い、ローパス画像Img[2]については、テンプレートT[2]{1}~テンプレートT[2]{36}を設定し、ローパス画像Img[3]については、テンプレートT[3]{1}~テンプレートT[3]{36}を設定する。 The template setting unit 25 performs the same processing for each of the low-pass images Img [2] and Img [3]. For the low-pass images Img [2], the templates T [2] {1} to T [2] {36} is set, and the template T [3] {1} to template T [3] {36} are set for the low-pass image Img [3].
 (ステップS105)
 CPU14は、マッチング処理部26により、対象画像Img[1]、ローパス画像Img[2]およびImg[3]のそれぞれについて、マッチング処理を行う。
(Step S105)
The CPU 14 performs matching processing on each of the target image Img [1], the low-pass images Img [2], and Img [3] by the matching processing unit 26.
 以下では、対象画像Img[1]におけるマッチング処理を例に挙げて説明する。マッチング処理部26は、対象画像Img[1]から、ステップS104で設定したテンプレートを除く部分(ブロックB[1] (2,2)~ブロックB[1] (9,9)の8×8=64ブロック)のそれぞれについて、評価値SAD[1] (i,j)を求める。 Hereinafter, the matching process in the target image Img [1] will be described as an example. The matching processing unit 26 removes the template set in step S104 from the target image Img [1] (block B [1] (2,2) to block B [1] (9,9) 8 × 8 = Evaluation value SAD [1] (i, j) is obtained for each of the 64 blocks.
 一例として、マッチング対象のブロックのうち、ブロックB[1] (2,2)について、評価値SAD[1] (2,2)を求める場合を例に挙げる。マッチング処理部26は、ブロックB[1] (2,2)の画像の画像データと、ステップS104で設定したテンプレート(テンプレートT[1]{1}~テンプレートT[1]{36})のそれぞれとを比較し、次式に示す差分絶対値総和SAD[1] (i,j){N}を求める。 As an example, a case where the evaluation value SAD [1] (2, 2) is obtained for the block B [1] (2, 2) among the blocks to be matched will be described as an example. The matching processing unit 26 stores the image data of the image of the block B [1] (2,2) and the templates (template T [1] {1} to template T [1] {36}) set in step S104. And the difference absolute value sum SAD [1] (i, j) {N} shown in the following equation is obtained.
Figure JPOXMLDOC01-appb-M000003
Figure JPOXMLDOC01-appb-M000003
 式6中左辺の[n]は画像の種類(ここではn=1)を示し、(i,j)はブロックの位置(ここでは、i=2,j=2)を示し、{N}はテンプレートの番号(ここでは1~36)を示す。また、図5中右辺は、マッチング処理の対象のブロック(ブロックB[n] (i,j))内の任意の画素の画素値と、任意のテンプレートのブロック(テンプレートT[n]{N}))内において、任意の画素に対応する位置の画素の画素値との差分の絶対値を、マッチング対象のブロック内のすべての画素について求めて加算することを示す。 [N] on the left side of Equation 6 indicates the type of image (here, n = 1), (i, j) indicates the position of the block (here, i = 2, j = 2), and {N} Indicates the template number (here, 1 to 36). Further, the right side in FIG. 5 indicates the pixel value of an arbitrary pixel in a block (block B [n] (i, j)) to be matched and an arbitrary template block (template T [n] {N}). )) Shows that the absolute value of the difference from the pixel value of the pixel at the position corresponding to an arbitrary pixel is obtained and added for all the pixels in the matching target block.
 式6で求まる差分絶対値総和SAD[1] (i,j){N}は、マッチング対象のブロックと、テンプレートとの適合度が高いほど値が小さくなる。 The difference absolute value sum SAD [1] (i, j) {N} obtained by Equation 6 decreases as the matching degree between the matching target block and the template increases.
 例えば、上述したブロックB[1] (2,2)と、テンプレートT[1]{1}に関して、差分絶対値総和SAD[1] (2,2){1}を求める場合には、マッチング処理部26は、ブロックB[1] (2,2) 内の任意の画素の画素値と、任意のテンプレートのブロック(テンプレートT[1]{1}=ブロックB[1] (1,1))内において、任意の画素に対応する位置の画素の画素値との差分の絶対値を、ブロックB[1] (2,2) 内のすべての画素について求めて加算し、絶対値総和SAD[1] (2,2){1}を求める。 For example, when the difference absolute value sum SAD [1] (2,2) {1} is obtained for the block B [1] (2,2) and the template T [1] {1}, the matching process is performed. The unit 26 calculates a pixel value of an arbitrary pixel in the block B [1] (2,2) and an arbitrary template block (template T [1] {1} = block B [1] (1,1)). The absolute value of the difference from the pixel value of the pixel at the position corresponding to an arbitrary pixel is obtained and added for all the pixels in the block B [1] (2,2) 加 算, and the absolute value sum SAD [1 ] Find (2,2) {1}.
 マッチング処理部26は、同様の処理を、ブロックB[1] (2,2)と、テンプレートT[1]{2}~テンプレートT[1]{36}とのそれぞれについても行い、絶対値総和SAD[1] (2,2){2}~絶対値総和SAD[1] (2,2){36}を求める。そして、次式を用いて、ブロックB[1] (2,2)についての評価値SAD[1] (2,2)を求める。 The matching processing unit 26 performs the same processing for each of the block B [1] (2,2) and the templates T [1] {2} to the templates T [1] {36}, and calculates the absolute value sum. SAD [1] (2,2) {2} to absolute value sum SAD [1] (2,2) {36} are obtained. Then, an evaluation value SAD [1] (2,2) for the block B [1] (2,2) is obtained using the following equation.
Figure JPOXMLDOC01-appb-M000004
Figure JPOXMLDOC01-appb-M000004
 式7中右辺のmin(X)は、Xの最小値を返す式であり、上述の例では、絶対値総和SAD[1] (2,2){1}~絶対値総和SAD[1] (2,2){36}の最小値を評価値SAD[1] (2,2)とする。 The min (X) on the right side of Expression 7 is an expression that returns the minimum value of X. In the above example, the absolute value sum SAD [1] (2,2) {1} to the absolute value sum SAD [1] ( 2,2) Let the minimum value of {36} be the evaluation value SAD [1] (2,2).
 マッチング処理部26は、以上の処理を、ブロックB[1] (3,2)~ブロックB[1] (9,9)についても行い、それぞれ、評価値SAD[1] (3,2)~評価値SAD[1] (9,9)を求める。この結果、対象画像Img[1]中のマッチング対象のブロック(ブロックB[1] (2,2)~ブロックB[1] (9,9)の8×8=64ブロック)のそれぞれについて、評価値SAD[1] (i,j)が求められる。 The matching processing unit 26 performs the above processing also for the block B [1] (3,2) to the block B [1] (9,9), and the evaluation value SAD [1] (3,2) ˜ The evaluation value SAD [1] (9, 9) is obtained. As a result, each of the matching target blocks (8 × 8 = 64 blocks from block B [1] 8 (2,2) to block B [1] (9,9)) in the target image Img [1] is evaluated. The value SAD [1] (i, j) is determined.
 また、マッチング処理部26は、同様の処理をローパス画像Img[2]およびImg[3]のそれぞれについても行い、ローパス画像Img[2]については、評価値SAD[2] (2,2)~評価値SAD[2] (9,9)を求め、ローパス画像Img[3]については、評価値SAD[3] (2,2)~評価値SAD[3] (9,9)を求める。 The matching processing unit 26 performs the same processing for each of the low-pass images Img [2] and Img [3]. For the low-pass image Img [2], the evaluation value SAD [2] (2, 2) ˜ Evaluation value SAD [2] (9,9) is obtained, and evaluation value SAD [3] (2,2) to evaluation value SAD [3] (9,9) is obtained for the low-pass image Img [3].
 なお、上述の例では、ステップS104においてテンプレートに設定されたブロックについてはマッチング処理を行わない例を示したが、テンプレートに設定されたブロックについても同様にマッチング処理を行っても良い。この場合には、評価値SAD[1] (i,j)の値は0となる。 In the above example, the example in which the matching process is not performed for the block set in the template in step S104 is shown, but the matching process may be similarly performed for the block set in the template. In this case, the value of the evaluation value SAD [1] , (i, j) is 0.
 (ステップS106)
 CPU14は、マップ作成部27により、対象画像Img[1]、ローパス画像Img[2]およびImg[3]のそれぞれについて、マップの作成を行う。
(Step S106)
The CPU 14 uses the map creation unit 27 to create a map for each of the target image Img [1], the low-pass image Img [2], and Img [3].
 以下では、対象画像Img[1]におけるマップの作成を例に挙げて説明する。マップ作成部27は、対象画像Img[1]についてステップS105で求めた評価値SAD[1] (2,2)~評価値SAD[1] (9,9)に基づいて、対象画像Img[1]に関するマップSal[1]を作成する。 In the following, the creation of a map in the target image Img [1] will be described as an example. Based on the evaluation value SAD [1] (2,2) to evaluation value SAD [1] (9,9) obtained in step S105 for the target image Img [1], the map creation unit 27 performs the target image Img [1]. ] Map Sal [1] is created.
 マップ作成部27は、ステップS105で求めた評価値SAD[1] (2,2)~評価値SAD[1] (9,9)を、それぞれ閾値THと比較して、各ブロックに割り当てる画素値を決定する。例えば、上述したブロックB[1] (2,2)に関して、マップ作成部27は、評価値SAD[1] (2,2)と、閾値THとを比較し、SAD[1] (2,2)>閾値THである場合には、ブロックB[1] (2,2)内のすべての画素の画素値を、SAD[1] (2,2)の値に置き換える。一方、SAD[1] (2,2)≦閾値THである場合には、マップ作成部27は、ブロックB[1] (2,2)内のすべての画素の画素値を0とする。 The map creation unit 27 compares the evaluation value SAD [1] (2,2) to the evaluation value SAD [1] (9,9) obtained in step S105 with the threshold value TH, and assigns the pixel value to each block. To decide. For example, for the block B [1] (2,2) described above, the map creation unit 27 compares the evaluation value SAD [1] (2,2) with the threshold value TH and calculates SAD [1] (2,2). )> If the threshold value TH is satisfied, the pixel values of all the pixels in the block B [1] (2,2) are replaced with the values of SAD [1] (2,2). On the other hand, when SAD [1] (2,2) ≦ threshold TH, the map creating unit 27 sets the pixel values of all the pixels in the block B [1] (2,2) to zero.
 なお、閾値THとは、ステップS105で求めた評価値SAD[n] (i,j)が取り得る範囲に応じて定められる閾値(ステップS103における分割数などに応じて決まる。例えば、評価値SAD[n] (i,j)が取り得る範囲の下側10%程度など)である。この閾値THが小さいほど、比較対象の評価値に対応するブロックに、主要被写体が存在すると推定される可能性(背景領域ではないと推定される可能性)が高くなり、この閾値THが大きいほど、主要被写体が存在しないと推定される可能性(背景領域であると推定される可能性)が高くなる。 Note that the threshold value TH is determined according to a threshold value determined according to a range that the evaluation value SAD [n] な ど (i, j) obtained in step S105 can take (for example, the evaluation value SAD). [n] is about 10% below the range that can be taken by (i, j)). The smaller this threshold TH, the higher the possibility that a main subject is present in the block corresponding to the evaluation value to be compared (the possibility that it is not a background area), and the larger this threshold TH is. The possibility that it is estimated that the main subject does not exist (the possibility that it is assumed to be the background region) increases.
 また、SAD[1] (2,2)>閾値THである場合とは、ブロックB[1] (2,2)には、主要被写体が存在すると推定できる、つまり、ブロックB[1] (2,2)は、背景領域ではないと推定できる場合である。このような場合、ブロックB[1] (2,2)内のすべての画素の画素値を、SAD[1] (2,2)の値に置き換えることにより、主要被写体に応じた画素値を割り当てることができる。一方、SAD[1] (2,2)≦閾値THである場合とは、ブロックB[1] (2,2)には、主要被写体が存在しないと推定できる、つまり、ブロックB[1] (2,2)は、背景領域であると推定できる場合である。このような場合、ブロックB[1] (2,2)内のすべての画素の画素値を0とすることにより、背景領域に応じた画素値を割り当てることができる。 Further, when SAD [1] 2 , (2,2)> threshold TH, it can be estimated that the main subject exists in block B [1] (2,2), that is, block B [1] (2 , 2) is a case where it can be estimated that it is not a background region. In such a case, the pixel values corresponding to the main subject are assigned by replacing the pixel values of all the pixels in the block B [1] (2,2) with the values of SAD [1] (2,2). be able to. On the other hand, when SAD [1] (2,2) ≦ threshold TH, it can be estimated that there is no main subject in block B [1] (2,2), that is, block B [1] ( 2, 2) is a case where it can be estimated that it is a background region. In such a case, pixel values corresponding to the background area can be assigned by setting the pixel values of all the pixels in the block B [1] (2, 2) to 0.
 さらに、マップ作成部27は、ステップS104においてテンプレートとして設定した各ブロック(テンプレートT[1]{1}~テンプレートT[1]{36}に対応する36個のブロック、図5参照)については、各ブロック内のすべての画素値を0とする。これは、上述した閾値THとの比較をしなくても、これらのブロックは、背景領域であると推定できるためである。 Further, for each block (36 blocks corresponding to template T [1] {1} to template T [1] {36}, see FIG. 5) set as a template in step S104, the map creating unit 27 All pixel values in each block are set to 0. This is because these blocks can be estimated to be the background region without comparison with the threshold value TH described above.
 上述した処理により、ブロックごとに新たな画素値を割り当てた全体を、対象画像Img[1]に関するマップSal[1]とする。 The map to which the new pixel value is assigned for each block by the above-described processing is the map Sal [1] related to the target image Img [1].
 また、マップ作成部27は、同様の処理をローパス画像Img[2]およびImg[3]のそれぞれについても行い、ローパス画像Img[2]については、マップSal[2]を作成し、ローパス画像Img[3]については、マップSal[3]を作成する。なお、ローパス画像Img[2]およびImg[3]に関するマップの作成においては、対象画像Img[1]に関するマップの作成に用いた閾値THと同じ閾値を用いても良いし、異なる閾値を用いても良い。 The map creation unit 27 performs the same processing for each of the low-pass images Img [2] and Img [3], creates a map Sal [2] for the low-pass image Img [2], and creates the low-pass image Img. For [3], a map Sal [3] is created. Note that, in the creation of the maps related to the low-pass images Img [2] and Img [3], the same threshold value TH used for creating the map related to the target image Img [1] may be used, or a different threshold value may be used. Also good.
 最後に、マップ作成部27は、対象画像Img[1]に関するマップSal[1]、ローパス画像Img[2] に関するマップSal[2]、ローパス画像Img[3]に関するマップSal[3]に基づき、次式を用いて、最終的なマップSal[T]を作成する。 Finally, the map creation unit 27 is based on the map Sal [1] regarding the target image Img [1], the map Sal [2] regarding the low-pass image Img [2] 2, and the map Sal [3] regarding the low-pass image Img [3]. The final map Sal [T] is created using the following equation.
Figure JPOXMLDOC01-appb-M000005
Figure JPOXMLDOC01-appb-M000005
 式8中のw1,w2,w3は、各マップの重み付け量を示す。マップ作成部27は、マップSal[1]、マップSal[2]、マップSal[3]にそれぞれ重み付けを行い、各マップにおいて対応する各画素の画素値を、それぞれ加算することにより、マップSal[T]を作成する。 W1, w2, and w3 in Equation 8 indicate the weighting amount of each map. The map creation unit 27 weights the map Sal [1], the map Sal [2], and the map Sal [3], and adds the pixel values of the corresponding pixels in each map, thereby adding the map Sal [ T] is created.
 なお、重みw1,w2,w3は、ステップS104で設定したテンプレートにおける周波数成分などにより定められる。例えば、上述したテンプレートにノイズが多い場合には、ローパス画像Img[2] に関するマップSal[2]の重みw2、ローパス画像Img[3]に関するマップSal[3]の重みw3を相対的に大きくし、ノイズが少ない場合には、対象画像Img[1]に関するマップSal[1]の重みw1を相対的に大きくすると良い。この他にも、例えば、対象画像Img[1]を撮影した際に、撮像装置において設定された撮影モード(「ポートレートモード」、「風景モード」など)や、被写体認識の結果などに基づいて、重みw1,w2,w3を定めても良い。 Note that the weights w1, w2, and w3 are determined by the frequency components in the template set in step S104. For example, when the template described above is noisy, the weight w2 of the map Sal [2] relating to the low-pass image Img [2] and the weight w3 of the map Sal [3] relating to the low-pass image Img [3] are relatively increased. When the noise is low, the weight w1 of the map Sal [1] related to the target image Img [1] may be relatively increased. In addition to this, for example, when the target image Img [1] is photographed, based on the photographing mode (“portrait mode”, “landscape mode”, etc.) set in the imaging device, the result of subject recognition, and the like. The weights w1, w2, and w3 may be determined.
 図6に、このようにして作成されたマップSal[T]の例を示す。図6Aは、ステップS101で取得した対象画像Img[1]を示し、図6Bは、ステップS106で作成されたマップSal[T]を示す。図6Aにおいては、背景部分に枝、葉、金網などが写り込んでいる。このような部分は、従来の方法では背景であるにもかかわらず、主要被写体領域として認識されていた。しかし、本実施形態によれば、これらの部分の画像を利用してテンプレートを設定しているため、図6Bに示すように、これらの部分は、主要被写体領域として誤認識されず、主要被写体である鳥の部分のみがマップSal[T]に残ることになる。 FIG. 6 shows an example of the map Sal [T] created in this way. 6A shows the target image Img [1] acquired in step S101, and FIG. 6B shows the map Sal [T] created in step S106. In FIG. 6A, branches, leaves, wire nets, etc. are reflected in the background portion. Such a portion has been recognized as a main subject area in spite of the background in the conventional method. However, according to the present embodiment, since the templates are set using the images of these portions, as shown in FIG. 6B, these portions are not misrecognized as the main subject region, but are the main subjects. Only certain bird portions will remain on the map Sal [T].
 (ステップS107)
 CPU14は、ステップS106で求めたマップSal[T]を、対象画像Img[1]と対応づけて記録する。例えば、マップSal[T]を、対象画像Img[1]の付帯情報として記録しても良いし、マップSal[T]に、その情報が対象画像Img[1]に関するものであることを示す識別情報を付与しても良い。
(Step S107)
The CPU 14 records the map Sal [T] obtained in step S106 in association with the target image Img [1]. For example, the map Sal [T] may be recorded as supplementary information of the target image Img [1], or the map Sal [T] is identified to indicate that the information relates to the target image Img [1]. Information may be given.
 (ステップS108)
 CPU14は、ステップS106で求めたマップSal[T]に基づいて、対象画像Img[1]と、主要被写体領域を示す領域を示すマーカーとをモニタ19に重畳表示する。
(Step S108)
Based on the map Sal [T] obtained in step S106, the CPU 14 superimposes and displays the target image Img [1] and a marker indicating the main subject area on the monitor 19.
 CPU14は、まず、マップSal[T]に基づいて、主要被写体領域を抽出する。CPU14は、マップSal[T]の各画素の値と所定の閾値TRとを比較し、閾値TRを超える画素をすべて含む最小矩形範囲を求めることにより、主要被写体領域を抽出する。なお、最小矩形範囲を求める際には、縦横比を固定して求める構成としても良い。 CPU 14 first extracts a main subject area based on the map Sal [T]. The CPU 14 compares the value of each pixel of the map Sal [T] with a predetermined threshold value TR and obtains a minimum rectangular range including all pixels exceeding the threshold value TR, thereby extracting a main subject region. Note that when obtaining the minimum rectangular range, the aspect ratio may be obtained with a fixed aspect ratio.
 なお、閾値TRとは、マップSal[T]に含まれる各画素が取り得る値の範囲に応じて定められる閾値である。この閾値TRが小さいほど、主要被写体領域として抽出される領域がより広くなる可能性が高くなり、この閾値TRが大きいほど、主要被写体領域として抽出される領域がより狭くなる可能性が高くなる。 The threshold value TR is a threshold value that is determined according to the range of values that can be taken by each pixel included in the map Sal [T]. The smaller the threshold value TR, the higher the possibility that the region extracted as the main subject region will be wider. The larger the threshold value TR, the higher the possibility that the region extracted as the main subject region will become narrower.
 図7に、このようにして抽出された主要被写体領域の例を示す。図7Aは、図6Bに示したマップSal[T]に、上述した主要被写体領域を示す枠Faを重畳した図を示す。また、図7Bは、図6Aに示した対象画像Img[1]に、上述した主要被写体領域を示す枠Fbを重畳した図を示す。 FIG. 7 shows an example of the main subject area extracted in this way. FIG. 7A shows a diagram in which the frame Fa indicating the main subject area described above is superimposed on the map Sal [T] shown in FIG. 6B. FIG. 7B shows a diagram in which the frame Fb indicating the main subject region described above is superimposed on the target image Img [1] shown in FIG. 6A.
 マップSal[T]においては、図7Aに示すように、背景部分に写り込んでいる枝、葉、金網などは、主要被写体領域から除外されるので、好適な主要被写体領域の抽出を実現することができる。 In the map Sal [T], as shown in FIG. 7A, branches, leaves, wire meshes, etc. reflected in the background portion are excluded from the main subject region, so that a suitable main subject region can be extracted. Can do.
 次に、CPU14は、図7Bに示すように、対象画像Img[1]と、主要被写体領域を示す領域を示すマーカーである枠Fbとをモニタ19に重畳表示する。対象画像Img[1]においては、図7Bに示すように、背景部分に写り込んでいる枝、葉、金網などを除く部分に、主要被写体領域を示す枠Fbが表示される。 Next, as shown in FIG. 7B, the CPU 14 superimposes and displays the target image Img [1] and a frame Fb, which is a marker indicating the main subject area, on the monitor 19. In the target image Img [1], as shown in FIG. 7B, a frame Fb indicating the main subject area is displayed in a portion excluding branches, leaves, wire mesh, etc. reflected in the background portion.
 なお、図7の例では、主要被写体領域を矩形に抽出する例を示したが、本発明はこの例に限定されない。例えば、楕円形、多角形、あるいは、主要被写体領域の輪郭に沿った不規則な形状など、どのような形状であっても良い。 Although the example of FIG. 7 shows an example in which the main subject area is extracted into a rectangle, the present invention is not limited to this example. For example, any shape such as an ellipse, a polygon, or an irregular shape along the outline of the main subject region may be used.
 また、図7の例では、主要被写体領域を示す枠を表示する例を示したが、主要被写体領域が視認可能であれば、本発明はこの例に限定されない。例えば、枠を点滅させたり、所定の色の枠を表示しても良い。また、主要被写体領域とその他の領域との明るさや色を変えて表示しても良い。 In the example of FIG. 7, an example in which a frame indicating the main subject area is displayed is shown, but the present invention is not limited to this example as long as the main subject area is visible. For example, the frame may blink or a predetermined color frame may be displayed. Further, the brightness and color of the main subject area and other areas may be changed and displayed.
 CPU14は、上述した表示を行うと一連の処理を終了する。 CPU14 will complete | finish a series of processes, if the display mentioned above is performed.
 なお、上述した例では、ユーザによるプログラム実行指示に応じて、一連の処理を実行する例を示したが、本発明はこの例に限定されない。例えば、複数の画像に関するマップの作成を、一度のユーザ指示応じて行っても良い。また、データ読込部12を介して、外部から画像のデータを読み込むたびに、自動で一連の処理を実行しても良い。また、本実施形態で説明した画像処理装置を備えた撮像装置においては、撮像を行う際に一連の処理を実行する構成としても良い。また、本実施形態で説明した画像処理装置を備えた再生装置においては、画像の再生を行う際に一連の処理を実行する構成としても良い。 In the above-described example, an example in which a series of processing is executed according to a program execution instruction by the user is shown, but the present invention is not limited to this example. For example, a map for a plurality of images may be created in response to a single user instruction. In addition, a series of processes may be automatically executed every time image data is read from the outside via the data reading unit 12. In addition, the imaging apparatus including the image processing apparatus described in this embodiment may be configured to execute a series of processes when performing imaging. In addition, the reproduction apparatus including the image processing apparatus described in the present embodiment may be configured to execute a series of processes when reproducing an image.
 次に、マップSal[T]および抽出した主要被写体領域の利用方法について例を挙げて説明する。上述したように、マップSal[T]に基づいて、主要被写体領域を抽出することにより、画像の撮影時および再生時に利用することができる。 Next, a method for using the map Sal [T] and the extracted main subject area will be described with an example. As described above, by extracting the main subject area based on the map Sal [T], it can be used at the time of image capturing and reproduction.
 撮影時においては、以下の(a)および(b)の利用方法が考えられる。
(a)主要被写体領域(注目領域)への自動ズーム
 撮影時において、構図確認用のいわゆるスルー画像に基づいてマップSal[T]を作成することにより、撮影中に主要被写体領域への自動ズームを行うことができる。例えば、主要被写体領域が所定の大きさよりも小さい場合には、主要被写体領域を中心として自動で光学ズームまたは電子ズームを行うことにより、適切な撮影を行うことができる。
At the time of shooting, the following usage methods (a) and (b) are conceivable.
(A) Automatic zoom to the main subject area (attention area) At the time of shooting, the map Sal [T] is created based on a so-called through image for composition confirmation. It can be carried out. For example, when the main subject area is smaller than a predetermined size, it is possible to perform appropriate shooting by automatically performing optical zoom or electronic zoom around the main subject area.
 このような処理は、動画像の撮影時にも同様に行うことができる。何れの場合も、ズームの程度は、主要被写体領域がファインダ(撮影可能範囲)からはみ出ない程度に抑えることもできる。自動ズームを行うことにより、ユーザが撮影したいと思われる主要被写体を適切なズーム倍率で簡単に撮像することができる。
(b)AE,AF,AWBへの利用
 撮影時において、構図確認用のいわゆるスルー画像に基づいてマップSal[T]を作成することにより、撮影中に実行するAE,AF,AWBを行う範囲を好適に制御することができる。また、従来から行われている被写体認識などにマップSal[T]の情報を利用しても良い。
Such processing can be performed in the same manner when moving images are captured. In any case, the degree of zooming can be suppressed to such an extent that the main subject area does not protrude from the finder (shootable range). By performing automatic zooming, it is possible to easily capture the main subject that the user wants to photograph at an appropriate zoom magnification.
(B) Use for AE, AF, AWB At the time of shooting, a map Sal [T] is created based on a so-called through image for composition confirmation. It can control suitably. Further, the information of the map Sal [T] may be used for subject recognition that has been performed conventionally.
 このようなAF,AE,AWB等の処理は、動画像の撮影時にも同様に行うことができる。何れの場合も、マップSal[T]に基づいて主要被写体領域を検出し、主要被写体領域の重心位置を中心として、AF,AE,AWB等を行えば良い。このような処理により、主要被写体領域の動きを追尾しながら、その主要被写体に適したAF,AE,AWB等を実行することができる。 Such processing of AF, AE, AWB, etc. can be performed in the same manner when moving images are taken. In any case, the main subject area may be detected based on the map Sal [T], and AF, AE, AWB, etc. may be performed with the center of gravity of the main subject area as the center. By such processing, AF, AE, AWB, etc. suitable for the main subject can be executed while tracking the movement of the main subject region.
 また、撮影時において、スルー画像に基づいてマップSal[T]を作成することにより、自動シャッタ制御を行うことができる。例えば、連続的に生成されるスルー画像に対して、一定の時間間隔でマップSal[T]を作成して主要被写体領域を検出し、検出した主要被写体領域の大きさと位置との少なくとも一方を監視する。そして、主要被写体領域の大きさと位置との少なくとも一方が予め定めた適切な条件(予め設定されていても、ユーザにより設定されていても良い)となった場合には、自動シャッタ制御を行う。 Moreover, automatic shutter control can be performed by creating a map Sal [T] based on a through image at the time of shooting. For example, a map Sal [T] is created for a continuously generated through image at regular time intervals to detect a main subject region, and at least one of the detected size and position of the main subject region is monitored. To do. When at least one of the size and the position of the main subject region satisfies a predetermined appropriate condition (may be set in advance or set by the user), automatic shutter control is performed.
 このような自動シャッタ制御は、動画像の撮影時にも同様に行うことができる。何れの場合も、主要被写体領域の動きを追尾しながら、その主要被写体が好適な状態で自動的に撮像を行うことができる。 Such an automatic shutter control can be performed in the same manner when a moving image is taken. In either case, the main subject can be automatically imaged while tracking the movement of the main subject area.
 なお、上述したAF,AE,AWB等の処理および自動シャッタ制御を行う際には、何フレームか前までの制御条件を記憶しておき、現在のフレームにおける制御条件が、以前のフレームにおける制御条件と比べて著しく異なる場合には、追尾を禁止するようにしても良い。 When performing the above-described AF, AE, AWB, etc. processing and automatic shutter control, the control conditions up to several frames before are stored, and the control conditions in the current frame are the control conditions in the previous frame. If it is significantly different from the tracking, tracking may be prohibited.
 また、再生時においては、以下の(c)および(d)の利用方法が考えられる。
(c)スライドショーにおけるズーム中心の決定
 複数の画像を連続して再生、表示するスライドショーにおいて、画像の切り替え時などに表示効果としてズーム処理が良く行われる。このような場合に、マップSal[T]に基づいて主要被写体領域を抽出することにより、この主要被写体領域の中心をズーム中心とすることができる。その結果、ズーム処理の目的である「主要被写体領域(注目領域)を際立たせる」という効果に即した表示を行うことができる。
(d)主要被写体領域(注目領域)の自動クロップ
 複数の画像を一覧表示する際に、画像の一部を切り出して拡大する自動クロップにより、主要被写体領域のみを表示することが行われている。このような表示を行うことにより、複数の画像を一覧表示する際に、余分な情報を表示することなく、一覧性を保ったまま、一画面中に多量の画像を表示することができる。このような表示の例を図8に示す。図8Aは、従来の一覧表示の例である。このような表示の際に、マップSal[T]に基づいて自動クロップを行い、主要被写体領域のみを一覧表示する例を図8Bに示す。
Further, at the time of reproduction, the following usage methods (c) and (d) are conceivable.
(C) Determination of the zoom center in a slide show In a slide show in which a plurality of images are continuously reproduced and displayed, zoom processing is often performed as a display effect when switching images. In such a case, by extracting the main subject region based on the map Sal [T], the center of the main subject region can be set as the zoom center. As a result, it is possible to perform display in accordance with the effect of “prominent main subject region (region of interest)” that is the purpose of zoom processing.
(D) Automatic cropping of main subject area (attention area) When a plurality of images are displayed as a list, only the main subject area is displayed by automatic cropping by cutting out and enlarging a part of the image. By performing such display, when displaying a list of a plurality of images, a large amount of images can be displayed on one screen while maintaining the listability without displaying extra information. An example of such display is shown in FIG. FIG. 8A is an example of a conventional list display. FIG. 8B shows an example in which automatic cropping is performed based on the map Sal [T] and only the main subject area is displayed as a list during such display.
 なお、このような自動クロップは、撮影直後に表示される確認画像(いわゆるフリーズ画像)にも適用可能である。確認画像を表示する際に、自動クロップを行うことにより、ユーザは、主要被写体領域におけるピントの確認や手ブレの確認などを、容易に行うことができる。また、画像の再生時に、ユーザにより拡大表示の指示が行われた際にも、同様の処理を行うことにより、同様の効果を得ることができる。 Note that such automatic cropping can also be applied to a confirmation image (a so-called freeze image) displayed immediately after shooting. By performing automatic cropping when displaying the confirmation image, the user can easily confirm the focus in the main subject area, confirm the camera shake, and the like. In addition, when an enlargement display instruction is given by the user during image reproduction, the same effect can be obtained by performing the same processing.
 なお、自動クロップを行う際には、クロップの後の画像が適切なアスペクト比となるように、この主要被写体領域を縦方向もしくは横方向へ引き伸ばしてからクロップ処理を行っても良い。このように、アスペクト比を維持したクロップ処理を行うことにより、クロップ後の画像をアスペクト比が固定の外部装置などに出力する際にも、クロップ前の画像(対象画像)のアスペクト比を維持することができる。 Note that when performing automatic cropping, the main subject area may be stretched in the vertical or horizontal direction so that the cropped image has an appropriate aspect ratio, and then the cropping process may be performed. In this way, by performing the crop processing that maintains the aspect ratio, the aspect ratio of the image before cropping (the target image) is maintained even when the cropped image is output to an external device having a fixed aspect ratio. be able to.
 上記のように、第1実施形態の画像処理装置は、対象画像を複数のブロックに分割し、複数のブロックのうち、対象画像の外周部に存在する複数のブロックの画像に基づいて、複数のテンプレートを設定する。そして、対象画像を分割した複数のブロックの各々について代表値を算出し、マッチング対象のブロックの代表値と、複数のテンプレートにおける代表値とをそれぞれ比較することによるマッチングを、複数のブロックごとに行い、マッチングの結果に基づいて、対象画像における被写体の分布を示すマップを作成するものである。 As described above, the image processing apparatus according to the first embodiment divides the target image into a plurality of blocks, and based on the images of the plurality of blocks existing on the outer periphery of the target image among the plurality of blocks. Set the template. Then, a representative value is calculated for each of the plurality of blocks obtained by dividing the target image, and matching is performed for each of the plurality of blocks by comparing the representative value of the block to be matched with the representative value in the plurality of templates. Based on the matching result, a map showing the distribution of the subject in the target image is created.
 なお、上述した対象画像の外周部とは、例えば、対象画像の上下端からそれぞれ対象画像の高さの30%程度の範囲、および、対象画像の左右端からそれぞれ対象画像の幅の30%程度の範囲と考えることができる。 The above-described outer peripheral portion of the target image is, for example, a range of about 30% of the height of the target image from the upper and lower ends of the target image, and about 30% of the width of the target image from the left and right ends of the target image. Can be considered as a range.
 よって、第1実施形態の構成によれば、対象画像の外周部をテンプレートとすることにより、背景である領域を確実に検出することができる。そのため、作成したマップを用いて主要被写体領域を抽出することにより、高周波成分に依存したり、経験的な構図の想定を行ったりすることなく、対象画像に適合した方法で、主要被写体領域の抽出を行うことができる。 Therefore, according to the configuration of the first embodiment, by using the outer periphery of the target image as a template, it is possible to reliably detect the background area. Therefore, by extracting the main subject area using the created map, it is possible to extract the main subject area by a method suitable for the target image without depending on high-frequency components or assuming an empirical composition. It can be performed.
 特に、第1実施形態の構成によれば、従来から考えられている顔認識技術が主要被写体として顔を認識することに特化しているのと比較して、主要被写体が顔でない場合でもあっても、好適に主要被写体領域の抽出を行うことができる。さらに、ユーザによる各種指定や設定を必要とせずに、対象画像から主要被写体領域を抽出することができる。 In particular, according to the configuration of the first embodiment, the main subject is not a face as compared with the face recognition technology that has been conventionally considered to specialize in recognizing a face as the main subject. In addition, the main subject region can be preferably extracted. Furthermore, the main subject area can be extracted from the target image without requiring various designations and settings by the user.
 また、第1実施形態の構成によれば、対象画像よりも低解像度の画像を少なくとも1つ生成し、対象画像および低解像度の画像のそれぞれについて、被写体の分布を示すマップを作成し、作成した複数のマップに基づく演算を行うことにより、対象画像における被写体の分布を示すマップを作成するので、対象画像の外周部に主要被写体以外の被写体が写り込んでいる画像についても、好適なテンプレートを設定することができ。そのため、対象画像の外周部に高周波成分が乗っていたとしても、対象画像に適合した方法で、主要被写体領域の抽出を行うことができる。 In addition, according to the configuration of the first embodiment, at least one image having a lower resolution than the target image is generated, and a map indicating the distribution of the subject is generated for each of the target image and the low resolution image. Since a map showing the distribution of subjects in the target image is created by performing calculations based on multiple maps, a suitable template is set even for images in which subjects other than the main subject appear in the outer periphery of the target image Can Therefore, even if a high frequency component is on the outer periphery of the target image, the main subject region can be extracted by a method suitable for the target image.
 なお、第1実施形態においては、ステップS101で取得した対象画像Img[1]の画像データに基づいて、ローパス画像Img[2]およびImg[3]を生成する例を示したが、本発明はこの例に限定されない。例えば、3枚以上のローパス画像を生成する構成としても良い。この場合、生成した複数のローパス画像のそれぞれについてマップSal[n]を作成し、作成した複数のマップSal[n]を適宜重み付けして加算することにより、本実施形態と同様にマップSal[T]を作成することができる。 In the first embodiment, the low-pass images Img [2] and Img [3] are generated based on the image data of the target image Img [1] acquired in step S101. It is not limited to this example. For example, it may be configured to generate three or more low-pass images. In this case, a map Sal [n] is created for each of the plurality of generated low-pass images, and the created map Sal [n] is appropriately weighted and added, so that the map Sal [T] is the same as in the present embodiment. ] Can be created.
 また、第1実施形態においては、ステップS101で取得した対象画像Img[1]の画像データに基づいて、ローパス画像Img[2]およびImg[3]を生成する例を示したが、ローパス画像Img[2]およびImg[3]の生成を行わなくても良い。すなわち、ステップS101で取得した対象画像Img[1]についてのみ、ステップS103からステップS105の処理を行い、ステップS106において説明した、対象画像Img[1]に関するマップSal[1]をそのままマップSal[T]としても良い。 In the first embodiment, the low-pass images Img [2] and Img [3] are generated based on the image data of the target image Img [1] acquired in step S101. [2] and Img [3] need not be generated. That is, only the target image Img [1] acquired in step S101 is processed from step S103 to step S105, and the map Sal [1] related to the target image Img [1] described in step S106 is directly used as the map Sal [T. It is also good as.
 <第2実施形態の説明>
 以下、第2実施形態の画像処理装置の動作例を説明する。第2実施形態は第1実施形態におけるS102の処理の変形例である。なお、本明細書では以下の実施形態の説明において、第1実施形態と共通する画像処理装置の構成の重複説明は省略する。
<Description of Second Embodiment>
Hereinafter, an operation example of the image processing apparatus according to the second embodiment will be described. The second embodiment is a modification of the process of S102 in the first embodiment. In the present specification, in the description of the following embodiment, the description of the configuration of the image processing apparatus common to the first embodiment is omitted.
 第2実施形態の例では、第1実施形態におけるS102の処理に代えて、以下の処理を行う。 In the example of the second embodiment, the following process is performed instead of the process of S102 in the first embodiment.
 (ステップS102)
 CPU14は、領域分割部24により、ステップS101で取得した対象画像Img[1]の画像データに基づいて、リサイズ画像Img[2]およびImg[3]を生成する。リサイズ画像Img[2]の生成は、以下の式9により行われ、リサイズ画像Img[3]の生成は、以下の式10により行われる。
(Step S102)
The CPU 14 causes the area dividing unit 24 to generate resized images Img [2] and Img [3] based on the image data of the target image Img [1] acquired in step S101. The resized image Img [2] is generated according to the following Expression 9, and the resized image Img [3] is generated according to the following Expression 10.
Figure JPOXMLDOC01-appb-M000006
Figure JPOXMLDOC01-appb-M000006
 式9および式10中右辺のResize(X,Y)は、Xを倍率Yでリサイズ処理することを示す式である。領域分割部24は、式9に示すように、対象画像Img[1]を倍率rt1でリサイズしてリサイズ画像Img[2]を生成するとともに、式10に示すように、対象画像Img[1]を倍率rt2でリサイズしてリサイズ画像Img[3]を生成する。なお、倍率rt1および倍率rt2は、予め定められた倍率であり、ともに1未満で、rt1≠rt2である。 Resize (X, Y) on the right side of Expression 9 and Expression 10 is an expression indicating that X is resized with a magnification Y. The area dividing unit 24 generates the resized image Img [2] by resizing the target image Img [1] at the magnification rt1, as shown in Expression 9, and also, as shown in Expression 10, the target image Img [1]. Is resized at a magnification rt2 to generate a resized image Img [3]. Note that the magnification rt1 and the magnification rt2 are predetermined magnifications, both of which are less than 1 and rt1 ≠ rt2.
 なお、上述の例では、対象画像Img[1]の画像データに基づいて、リサイズ画像Img[2]およびImg[3]を生成する例を示したが、対象画像Img[1]の画像データに基づいて、リサイズ画像Img[2]を生成し、生成したリサイズ画像Img[2] の画像データに基づいて、リサイズ画像Img[3]を生成しても良い。 In the example described above, an example in which the resized images Img [2] and Img [3] are generated based on the image data of the target image Img [1] has been shown. However, the image data of the target image Img [1] Based on this, the resized image Img [2] may be generated, and the resized image Img [3] may be generated based on the image data of the generated resized image Img [2].
 ステップS103以降の処理において、CPU14は、ローパス画像Img[2]およびImg[3]に代えて、リサイズ画像Img[2]およびImg[3]を利用し、第1実施形態と同様の処理を行う。ただし、ステップS106において、マップSal[T]を作成する際には、式8に代えて、次式を用いる。 In the processing after step S103, the CPU 14 uses the resized images Img [2] and Img [3] instead of the low-pass images Img [2] and Img [3], and performs the same processing as in the first embodiment. . However, when creating the map Sal [T] in step S106, the following equation is used instead of equation 8.
Figure JPOXMLDOC01-appb-M000007
Figure JPOXMLDOC01-appb-M000007
 式11中のrt1およびrt2は、上述したリサイズ処理時の倍率rt1および倍率rt2である。リサイズ処理により、リサイズ画像Img[2]およびImg[3]は、対象画像Img[1]よりもサイズが小さくなるため、リサイズ画像Img[2]に関するマップSal[2]およびリサイズ画像Img[3]に関するマップSal[3]も、対象画像Img[1] に関するマップSal[1]よりもサイズが小さくなる。そのため、ステップS106において、マップSal[T]を作成する際には、リサイズ処理時の倍率rt1および倍率rt2の逆数をそれぞれ乗じてサイズをそろえた後に、重み付けおよび加算処理を行う。 Rt1 and rt2 in Equation 11 are the magnification rt1 and the magnification rt2 at the time of the resizing process described above. Due to the resizing process, the resized images Img [2] and Img [3] are smaller in size than the target image Img [1]. Therefore, the map Sal [2] and the resized image Img [3] related to the resized image Img [2]. The size of the map Sal [3] related to is smaller than the map Sal [1] related to the target image Img [1] [. For this reason, when creating the map Sal [T] in step S106, weights and addition processing are performed after the sizes are adjusted by multiplying the reciprocals of the magnification rt1 and the magnification rt2 at the time of the resizing processing.
 上記のように、第2実施形態の画像処理装置は、第1実施形態のローパス処理に代えて、ローパス処理と同様の低解像化処理(帯域制限処理)であるリサイズ処理を行う。そのため、第1実施形態の構成とほぼ同様の効果を得ることができる。また、第2実施形態の画像処理装置は、ローパス処理の代わりにリサイズ処理を行うことにより、処理の高速化が期待できる。 As described above, the image processing apparatus according to the second embodiment performs a resizing process, which is a low resolution process (band limiting process) similar to the low pass process, instead of the low pass process according to the first embodiment. Therefore, it is possible to obtain substantially the same effect as the configuration of the first embodiment. The image processing apparatus according to the second embodiment can be expected to increase the processing speed by performing the resizing process instead of the low-pass process.
 <第3実施形態の説明>
 以下、第3実施形態の画像処理装置の動作例を説明する。第3実施形態は第1実施形態および第2実施形態におけるS104の処理の変形例である。なお、本明細書では以下の実施形態の説明において、第1実施形態および第2実施形態と共通する画像処理装置の構成の重複説明は省略する。
<Description of Third Embodiment>
Hereinafter, an operation example of the image processing apparatus according to the third embodiment will be described. The third embodiment is a modification of the process of S104 in the first embodiment and the second embodiment. In the present specification, in the description of the following embodiments, the description of the configuration of the image processing apparatus common to the first embodiment and the second embodiment is omitted.
 第3実施形態の例では、第1実施形態におけるS104の処理に代えて、以下の処理を行う。 In the example of the third embodiment, the following process is performed instead of the process of S104 in the first embodiment.
 (ステップS104)
 CPU14は、テンプレート設定部25により、S103の分割処理による複数のブロックから、下辺を除く3辺に存在するすべてのブロックを選択し、テンプレートとして設定する。テンプレート設定部25は、テンプレートの設定を対象画像Img[1]、ローパス画像Img[2]およびImg[3]のそれぞれについて行う。
(Step S104)
The CPU 14 uses the template setting unit 25 to select all the blocks existing on the three sides excluding the lower side from the plurality of blocks obtained by the division processing in S103 and set them as templates. The template setting unit 25 performs template setting for each of the target image Img [1], the low-pass images Img [2], and Img [3].
 以下では、対象画像Img[1]におけるテンプレートの設定を例に挙げて説明する。テンプレート設定部25は、図9Aに示すように、対象画像Img[1]の 下辺を除く3辺に存在するブロック(図9A中、斜線で示したブロック)を選択し、テンプレートとして設定する。すなわち、図4で示した複数のブロックのうち、上辺に存在するブロックB[1] (1,1)~ブロックB[1] (10,1)の10個のブロックと、左辺に存在するブロックB[1] (1,2)~ブロックB[1] (1,10)の9個のブロックと、右辺に存在するブロックB[1] (10,2)~ブロックB[1] (10,10)の9個のブロックとの、合計28個のブロックをテンプレートとして設定する。なお、以下では、左上から右下の方向にテンプレートに番号Nを付し、各テンプレートをテンプレートT[1]{N}と表記する。上述したように、対象画像Img[1]の下辺を除く3辺に存在する28個のブロックが選択されると、図9に示すように、テンプレートT[1]{1}~テンプレートT[1]{28}の28個のテンプレートが設定されることになる。 Hereinafter, the setting of the template in the target image Img [1] will be described as an example. As shown in FIG. 9A, the template setting unit 25 selects blocks (blocks indicated by diagonal lines in FIG. 9A) existing on three sides excluding the lower side of the target image Img [1] and sets them as templates. That is, among the plurality of blocks shown in FIG. 4, 10 blocks from block B [1] (1,1) to block B [1] (10,1) existing on the upper side and blocks existing on the left side N blocks B [1] (1,2) to B [1] (1,10) and blocks B [1] (10,2) to B [1] (10, A total of 28 blocks including the 9 blocks of 10) are set as templates. In the following, the number N is assigned to the template from the upper left to the lower right, and each template is represented as a template T [1] {N}. As described above, when 28 blocks existing on the three sides excluding the lower side of the target image Img [1] are selected, as shown in FIG. 9, templates T [1] {1} to templates T [1] ] 28 templates of {28} are set.
 下辺を除く3辺に存在するすべてのブロックをテンプレートとして設定するのは、下辺に存在するブロックをテンプレートとして設定しないためである。これは、例えば、図9Aに示すようなバストアップの人物像のように、画像の下辺には、主要被写体(または主要被写体の延長)が存在する場合があり、そのような場合においては、下辺に存在するブロックは、テンプレートとして適さないためである。主要被写体が存在するブロックをテンプレートとして設定してしまうと、主要被写体が存在するブロックまで背景領域として抽出されてしてしまう。このような問題に対処するために、下辺を除く3辺に存在するすべてのブロックをテンプレートとして設定する。 The reason why all the blocks existing on the three sides excluding the lower side are set as the template is because the block existing on the lower side is not set as the template. For example, there may be a main subject (or an extension of the main subject) on the lower side of the image, such as a bust-up human image as shown in FIG. 9A. In such a case, the lower side This is because the block existing in is not suitable as a template. If a block in which the main subject exists is set as a template, the block in which the main subject exists is extracted as a background area. In order to deal with such a problem, all blocks existing on the three sides except the lower side are set as templates.
 なお、画像の上下は、対象画像Img[1]の撮像時における撮像装置の姿勢情報等に基づいて認識することができる。さらに、自動被写体認識や顔認識などの結果に基づいて、画像の上下を認識しても良い。例えば、図9Bに示すような横位置の画像については、対象画像Img[1]の 左辺を除く3辺に存在するブロック(図9B中、斜線で示したブロック)を選択し、テンプレートとして設定すればよい。 It should be noted that the top and bottom of the image can be recognized based on the orientation information of the imaging device when the target image Img [1] is captured. Furthermore, the top and bottom of the image may be recognized based on the results of automatic subject recognition, face recognition, and the like. For example, for an image in a horizontal position as shown in FIG. 9B, blocks that are present on three sides excluding the left side of the target image Img [1] (blocks indicated by diagonal lines in FIG. 9B) are selected and set as a template. That's fine.
 テンプレート設定部25は、同様の処理をローパス画像Img[2]およびImg[3]のそれぞれについても行い、ローパス画像Img[2]については、テンプレートT[2]{1}~テンプレートT[2]{28}を設定し、ローパス画像Img[3]については、テンプレートT[3]{1}~テンプレートT[3]{28}を設定する。 The template setting unit 25 performs the same processing for each of the low-pass images Img [2] and Img [3]. For the low-pass images Img [2], the templates T [2] {1} to T [2] {28} is set, and the template T [3] {1} to template T [3] {28} are set for the low-pass image Img [3].
 ステップS105以降の処理において、CPU14は、第1実施形態と同様の処理を行う。ただし、ステップS105において、差分絶対値総和SAD[1] (i,j){N}の算出対象となるテンプレートは、テンプレートT[1]{1}~テンプレートT[1]{28}の28個のテンプレートとなる。 In the processing after step S105, the CPU 14 performs the same processing as in the first embodiment. However, in step S105, the templates for which the absolute difference sum SAD [1] (i, j) {N} is calculated are 28 templates T [1] {1} to template T [1] {28}. Template.
 上記のように、第3実施形態の画像処理装置は、対象画像のうち、下辺を除く3辺に存在するすべてのブロックの画像に基づいて、複数のテンプレートを設定する。そのため、対象画像の下辺に主要被写体が存在する画像についても、好適なテンプレートを設定することができる。また、テンプレートの数を減らすことにより、処理の高速化が期待できる。 As described above, the image processing apparatus according to the third embodiment sets a plurality of templates based on the images of all blocks existing on the three sides of the target image except the lower side. Therefore, a suitable template can be set also for an image in which a main subject exists on the lower side of the target image. In addition, the processing speed can be increased by reducing the number of templates.
 なお、第3実施形態においては、下辺を除く3辺に存在するすべてのブロックの画像に基づいて、複数のテンプレートを設定する例を示したが、左辺および右辺に存在するすべてのブロックの画像に基づいて、複数のテンプレートを設定しても良い。 In the third embodiment, an example is shown in which a plurality of templates are set based on images of all blocks existing on the three sides except the lower side. However, images of all blocks existing on the left side and the right side are shown. Based on this, a plurality of templates may be set.
 また、第1実施形態および第3実施形態においては、対象となる辺(第1実施形態では、4辺すべて、第3実施形態では、3辺または2辺)に存在するすべてのブロックの画像に基づいて、複数のテンプレートを設定する例を示したが、一部のブロックの画像に基づいて、複数のテンプレートを設定しても良い。例えば、下辺を除く3辺に存在するすべてのブロックの画像と、下辺に存在する予め定められた一部のブロックの画像とに基づいて、テンプレートを設定しても良い。また、四隅に存在するブロックの画像に基づいて、複数のテンプレートを設定しても良い。 In the first and third embodiments, the image of all blocks existing on the target side (all four sides in the first embodiment, three sides or two sides in the third embodiment) are included. Although an example in which a plurality of templates are set based on the above is shown, a plurality of templates may be set based on an image of some blocks. For example, the template may be set based on images of all blocks existing on three sides except the lower side and images of some predetermined blocks existing on the lower side. Also, a plurality of templates may be set based on the block images existing at the four corners.
 <第4実施形態の説明>
 以下、第4実施形態の画像処理装置の動作例を説明する。第4実施形態は、上記した第3実施形態と同様に、第1実施形態および第2実施形態におけるS104の処理の変形例である。したがって、第3実施形態と同様に、本明細書では以下の実施形態の説明において、第1実施形態および第2実施形態と共通する画像処理装置の構成の重複説明は省略する。
<Description of Fourth Embodiment>
Hereinafter, an operation example of the image processing apparatus according to the fourth embodiment will be described. The fourth embodiment is a modification of the process of S104 in the first embodiment and the second embodiment, similarly to the third embodiment described above. Therefore, as in the third embodiment, in the description of the following embodiment, the description of the configuration of the image processing apparatus common to the first embodiment and the second embodiment is omitted in this specification.
 第4実施形態の例では、第1実施形態におけるS104の処理に代えて、以下の処理を行う。 In the example of the fourth embodiment, the following process is performed instead of the process of S104 in the first embodiment.
 (ステップS104)
 CPU14は、テンプレート設定部25により、マッチング対象のブロックの、画像内における位置に基づいて、S103の分割処理による複数のブロックから、画像の最外周に存在するすべてのブロックから、一部のブロックを選択し、テンプレートとして設定する。テンプレート設定部25は、テンプレートの設定を対象画像Img[1]、ローパス画像Img[2]およびImg[3]のそれぞれについて行う。
(Step S104)
The CPU 14 uses the template setting unit 25 to select a part of blocks from a plurality of blocks obtained by the division processing in S103 and all blocks existing on the outermost periphery of the image based on the position of the matching target block in the image. Select and set as template. The template setting unit 25 performs template setting for each of the target image Img [1], the low-pass images Img [2], and Img [3].
 以下では、対象画像Img[1]におけるテンプレートの設定を例に挙げて説明する。テンプレート設定部25は、最外周に存在するブロック除くブロック(ブロックB[1] (2,2)~ブロックB[1] (9,9)の8×8=64ブロック)のそれぞれについて、個別にテンプレートを設定する。テンプレート設定部25は、対象画像Img[1]内におけるブロックB[1] (i,j)の位置に基づいて、対象画像Img[1]の最外周に存在するすべてのブロックのうち、上辺に存在するブロックB[1] (i-1,1),ブロックB[1] (i,1),ブロックB[1] (i+1,1)と、左辺に存在するブロックB[1] (1,j-1),ブロックB[1] (1,j),ブロックB[1] (1,j+1)と、右辺に存在するブロックB[1] (10,j-1),ブロックB[1] (10,j),ブロックB[1] (10,j+1)と、下辺に存在するブロックB[1] (i-1,10),ブロックB[1] (i,10),ブロックB[1] (i+1,10)とを選択してテンプレートとして設定する。 Hereinafter, the setting of the template in the target image Img [1] will be described as an example. The template setting unit 25 individually handles each of the blocks (8 × 8 = 64 blocks from block B [1] (2,2) to block B [1] (9,9)) excluding the block existing on the outermost periphery. Set the template. Based on the position of the block B [1] (i, j) in the target image Img [1], the template setting unit 25 sets the upper side of all the blocks existing on the outermost periphery of the target image Img [1]. Block B [1] 1 (i−1,1), block B [1] (i, 1), block B [1] (i + 1,1), and block B [1] (1, j-1), block B [1] (1, j), block B [1] (1, j + 1), block B [1] (10, j-1), block B [1] existing on the right side (10, j), block B [1] (10, j + 1), block B [1] (i−1,10), block B [1] (i, 10), block B [1 existing on the lower side ] (I + 1, 10) is selected and set as a template.
 例えば、図10に示すように、ブロックB[1] (6,4)について、テンプレートを設定する場合には、上辺に存在するブロックB[1] (5,1),ブロックB[1] (6,1),ブロックB[1] (7,1)と、左辺に存在するブロックB[1] (1,3),ブロックB[1] (1,4),ブロックB[1] (1,5)と、右辺に存在するブロックB[1] (10,3),ブロックB[1] (10,4),ブロックB[1] (10,5)と、下辺に存在するブロックB[1] (5,10),ブロックB[1] (6,10),ブロックB[1] (7,10)とを選択してテンプレートとして設定する。すなわち、テンプレート設定部25は、図4で示した複数のブロックのうち、合計12個のブロックをテンプレートとして設定する。 For example, as shown in FIG. 10, when a template is set for block B [1] (6,4), block B [1] (5,1), block B [1] ( 6,1), block B [1] (7,1), block B [1] (1,3), block B [1] (1,4), block B [1] (1 5), block B [1] 1 (10,3), block B [1] (10,4), block B [1] (10,5) existing on the right side, and block B [ 1] (5, 10), block B [1] (6, 10), and block B [1] (7, 10) are selected and set as templates. That is, the template setting unit 25 sets a total of 12 blocks among the plurality of blocks shown in FIG. 4 as templates.
 なお、以下では、左上から右下の方向にテンプレートに番号Nを付し、各テンプレートをテンプレートT[1](i,j){N}と表記する。テンプレートT[1](i,j){N}中の(i,j)は、ブロックB[1] (i,j)に関して設定されたテンプレートであることを示す。 In the following, the number N is assigned to the templates from the upper left to the lower right, and each template is represented as a template T [1] (i, j) {N}. (I, j) in the template T [1] (i, j) {N} indicates that it is a template set for the block B [1] (i, j).
 上述したように、ブロックB[1] (6,4)の位置に基づいて12個のブロックが選択されると、図10に示すように、テンプレートT[1] (6,4){1}~テンプレートT[1] (6,4){12}の12個のテンプレートが設定されることになる。 As described above, when 12 blocks are selected based on the position of the block B [1] 1 (6,4), as shown in FIG. 10, the template T [1] {(6,4) {1} Twelve templates of template T [1] (6,4) {12} are set.
 テンプレート設定部25は、同様の処理をローパス画像Img[2]およびImg[3]のそれぞれについても行い、ローパス画像Img[2]については、ブロックB[2] (2,2)~ブロックB[2] (9,9)のそれぞれのブロックについて、テンプレートT[2] (i,j){1}~テンプレートT[2] (i,j){12}を設定する。また、ローパス画像Img[3]については、ブロックB[3] (2,2)~ブロックB[3] (9,9)のそれぞれのブロックについて、テンプレートT[3] (i,j){1}~テンプレートT[3] (i,j){12}を設定する。 The template setting unit 25 performs the same processing for each of the low-pass images Img [2] and Img [3]. For the low-pass image Img [2], the block B [2] (2,2) to the block B [ 2] Template T [2] (i, j) {1} to template T [2] (i, j) {12} are set for each block of (9,9). For the low-pass image Img [3], the template T [3] (i, j) {1 for each of the blocks B [3] (2,2) to B [3] (9,9). } To template T [3] (i, j) {12} are set.
 ステップS105以降の処理において、CPU14は、第1実施形態と同様の処理を行う。ただし、ステップS105において、マッチング処理を行う際には、ブロックごとに異なるテンプレートを用いて差分絶対値総和SAD[n] (i,j){N}を求める。また、差分絶対値総和SAD[n] {N}の算出対象となるテンプレートは、各ブロックごとに、それぞれテンプレートT[n] (i,j){1}~テンプレートT[n] (i,j){12}の12個のテンプレートとなる。 In the processing after step S105, the CPU 14 performs the same processing as in the first embodiment. However, when matching processing is performed in step S105, a difference absolute value sum SAD [n] (i, j) {N} is obtained using a template that is different for each block. In addition, templates for which the absolute difference sum SAD [n] n {N} is calculated are, for each block, templates T [n] (i, j) {1} to templates T [n] (i, j). ) Twelve templates of {12}.
 なお、上述の例では、テンプレート設定部25は、対象画像Img[1]内におけるブロックB[1] (i,j)の位置に基づいて、対象画像Img[1]の最外周に存在するすべてのブロックのうち、それぞれの辺ごとに3つのブロックを選択してテンプレートとして設定する例を示した。しかし、変数a(ただし、aは0以上の整数)を用いて、それぞれの辺ごとに(2a+1)個のブロックを選択する構成としても良い。すなわち、上辺に存在するブロックB[1] (i-a,1)~ブロックB[1] (i+a,1)と、左辺に存在するブロックB[1] (1,j-a)~ブロックB[1] (1,j+a)と、右辺に存在するブロックB[1] (10,j-a)~ブロックB[1] (10,j+a)と、下辺に存在するブロックB[1] (i-a,10)~ブロックB[1] (i+a,10)とを選択してテンプレートとして設定すればよい。なお、変数aは、ステップS103で行ったブロック分割時の分割数などに応じて定めれば良い。 In the above-described example, the template setting unit 25 uses all the positions present on the outermost periphery of the target image Img [1] based on the position of the block B [1] (i, j) in the target image Img [1]. In this example, three blocks are selected for each side and set as a template. However, the configuration may be such that (2a + 1) blocks are selected for each side using the variable a (where a is an integer of 0 or more). That is, block B [1] (ia, 1) to block B [1] (i + a, 1) existing on the upper side and block B [1] (1, ja) to block B existing on the left side [1] (1, j + a), block B [1] (10, j−a) to block B [1] (10, j + a) existing on the right side, and block B [1] (i existing on the lower side -A, 10) to block B [1] (i + a, 10) may be selected and set as a template. The variable a may be determined according to the number of divisions at the time of block division performed in step S103.
 上記のように、第4実施形態の画像処理装置は、マッチング対象のブロックの、対象画像内における位置に基づいて、対象画像の最外周に存在するすべてのブロックから、一部のブロックを選択し、選択した複数のブロックの画像に基づいて複数のテンプレートを設定する。 As described above, the image processing apparatus according to the fourth embodiment selects some blocks from all blocks existing on the outermost periphery of the target image based on the position of the matching target block in the target image. A plurality of templates are set based on the images of the selected plurality of blocks.
 よって、第4実施形態の構成によっても、第3実施形態と同様に、テンプレートの数を減らし、処理の高速化が期待できる。 Therefore, according to the configuration of the fourth embodiment, the number of templates can be reduced and the processing speed can be increased as in the third embodiment.
 なお、第1実施形態から第4実施形態においては、最外周に存在するブロックの画像に基づいて、複数のテンプレートを設定する例を示したが、本発明はこの例に限定されない。例えば、最外周の1周内側に存在するブロックの画像に基づいて、複数のテンプレートを設定しても良い。例えば、図4の例では、上辺の1周内側に存在するブロックB[1] (2,2)~ブロックB[1] (9,2)の8個のブロックと、左辺の1周内側に存在するブロックB[1] (2,3)~ブロックB[1] (2,90)の7個のブロックと、右辺の1周内側に存在するブロックB[1] (9,3)~ブロックB[1] (9,9)の7個のブロックとの、合計22個のブロックをテンプレートとして設定しても良い。このような設定とすることにより、例えば、対象画像Img[1]が、額縁に入った絵である場合など、構図がある程度決まっている場合にも好適に対応することができる。 In the first to fourth embodiments, an example in which a plurality of templates are set based on the image of a block existing on the outermost periphery has been described. However, the present invention is not limited to this example. For example, a plurality of templates may be set based on an image of a block existing on the innermost circumference of the outermost circumference. For example, in the example of FIG. 4, eight blocks B [1] (2,2) to B [1] (9,2) existing on the inner side of the upper side and the inner side of the left side of the upper side. Seven blocks from existing block B [1] 3 (2,3) to block B [1] (2,90), and block B [1] (9,3) to block existing one round inside of the right side A total of 22 blocks, including 7 blocks of B [1] (9, 9), may be set as a template. With such a setting, for example, it is possible to appropriately cope with a case where the composition is determined to some extent, such as when the target image Img [1] is a picture in a frame.
 また、各辺におけるブロック数は同一でなくても良い。例えば、上辺については、2ライン分のブロックの画像に基づいて複数のテンプレートを設定し、左辺および右辺については1ライン分のブロックの画像に基づいて複数のテンプレートを設定しても良い。 Also, the number of blocks on each side may not be the same. For example, for the upper side, a plurality of templates may be set based on a block image for two lines, and for the left side and the right side, a plurality of templates may be set based on a block image for one line.
 <第5実施形態の説明>
 以下、第5実施形態の画像処理装置の動作例を説明する。第5実施形態は、上記した第1実施形態から第4実施形態におけるS105の処理の変形例である。なお、本明細書では以下の実施形態の説明において、第1実施形態から第4実施形態と共通する画像処理装置の構成の重複説明は省略する。
<Description of Fifth Embodiment>
Hereinafter, an operation example of the image processing apparatus according to the fifth embodiment will be described. The fifth embodiment is a modification of the process of S105 in the first to fourth embodiments described above. In the present specification, in the description of the following embodiments, the description of the configuration of the image processing apparatus common to the first to fourth embodiments is omitted.
 第5実施形態の例では、第1実施形態におけるS105の処理に代えて、以下の処理を行う。 In the example of the fifth embodiment, the following process is performed instead of the process of S105 in the first embodiment.
 (ステップS105)
 CPU14は、マッチング処理部26により、対象画像Img[1]、ローパス画像Img[2]およびImg[3]のそれぞれについて、マッチング処理を行う。
(Step S105)
The CPU 14 performs matching processing on each of the target image Img [1], the low-pass images Img [2], and Img [3] by the matching processing unit 26.
 以下では、対象画像Img[1]におけるマッチング処理を例に挙げて説明する。マッチング処理部26は、対象画像Img[1]について、ステップS103でブロック分割した各ブロック(ブロックB[1] (1,1)~ブロックB[1] (10,10))について、次式を用いて周波数特徴量を求める。なお、ステップS104で設定したテンプレートに対応するブロック(テンプレートT[1]{1}~テンプレートT[1]{36})については、式12を用いて周波数特徴量f[1]{N}を求め、対象画像Img[1]から、ステップS104で設定したテンプレートを除く部分(ブロックB[1] (2,2)~ブロックB[1] (9,9)の8×8=64ブロック)のそれぞれについては、式13を用いて周波数特徴量f[1] (i,j)を求める。 Hereinafter, the matching process in the target image Img [1] will be described as an example. The matching processing unit 26 calculates the following expression for each block (block B [1] (1,1) to block B [1] (10,10)) obtained by dividing the block in step S103 for the target image Img [1]. To determine the frequency feature. For the blocks (template T [1] {1} to template T [1] {36}) corresponding to the template set in step S104, the frequency feature quantity f [1] {N} is calculated using Expression 12. The portion of the target image Img [1] excluding the template set in step S104 (8 × 8 = 64 blocks from block B [1] (2,2) to block B [1] (9,9)) is obtained. For each, the frequency feature quantity f [1] (i, j) is obtained using Equation 13.
Figure JPOXMLDOC01-appb-M000008
Figure JPOXMLDOC01-appb-M000008
 フーリエ変換の詳細については、第1実施形態のステップS102で説明したものと同様である。マッチング処理部26は、周波数特徴量f[1]{1}~周波数特徴量f[1]{36}および、周波数特徴量f[1] (2,2) ~周波数特徴量f[1] (9,9)をそれぞれ求め、対象画像Img[1]から、ステップS104で設定したテンプレートを除く部分のそれぞれについて、評価値fSAD[1] (i,j)を求める。 Details of the Fourier transform are the same as those described in step S102 of the first embodiment. The matching processing unit 26 performs frequency feature quantity f [1] {1} to frequency feature quantity f [1] {36} and frequency feature quantity f [1] (2,2) to frequency feature quantity f [1] ( 9 and 9) are obtained, and the evaluation value fSAD [1] i (i, j) is obtained for each portion excluding the template set in step S104 from the target image Img [1].
 一例として、マッチング対象のブロックのうち、ブロックB[1] (2,2)について、評価値fSAD[1] (2,2)を求める場合を例に挙げる。マッチング処理部26は、ブロックB[1] (2,2)の周波数特徴量f[1] (2,2)と、ステップS104で設定したテンプレート(テンプレートT[1]{1}~テンプレートT[1]{36})の周波数特徴量f[1]{1}~周波数特徴量fT[1]{36}とをそれぞれ比較し、次式に示す差分絶対値総和fSAD[1] (i,j){N}を求める。 As an example, a case where the evaluation value fSAD [1] (2, 2) is obtained for the block B [1] (2, 2) among the blocks to be matched will be described as an example. The matching processing unit 26 uses the frequency feature quantity f [1] (2,2) of the block B [1] (2,2) and the templates (template T [1] {1} to template T [ 1] {36}) are compared with the frequency feature quantity f [1] {1} to the frequency feature quantity fT [1] {36}, respectively, and the sum of absolute differences fSAD [1] (i, j ) Find {N}.
Figure JPOXMLDOC01-appb-M000009
Figure JPOXMLDOC01-appb-M000009
 式14中左辺の[n]は画像の種類(ここではn=1)を示し、(i,j)はブロックの位置(ここでは、i=2,j=2)を示し、{N}はテンプレートの番号(ここでは1~36)を示す。また、式14中右辺は、マッチング処理の対象のブロック(ブロックB[n] (i,j))内の任意の画素に対応する周波数特徴量f[1] (i,j)の値と、任意のテンプレートのブロック(テンプレートT[n]{N}))内において、任意の画素に対応する位置の画素に対応する周波数特徴量fT[1]{N}の値との差分の絶対値を、マッチング対象のブロック内のすべての画素に対応する領域(=B[n] (i,j)の台)について求めて加算することを示す。 [N] on the left side of Expression 14 indicates the type of image (here, n = 1), (i, j) indicates the position of the block (here, i = 2, j = 2), and {N} Indicates the template number (here, 1 to 36). Further, the right side of Expression 14 represents the value of the frequency feature quantity f [1] (i, j) corresponding to an arbitrary pixel in the block (block B [n] (i, j)) to be matched, In an arbitrary template block (template T [n] {N})), the absolute value of the difference from the value of the frequency feature quantity fT [1] {N} corresponding to the pixel at the position corresponding to the arbitrary pixel is calculated. , The area corresponding to all the pixels in the matching target block (= B [n] (i, j) base) is obtained and added.
 式14で求まる差分絶対値総和fSAD[1] (i,j){N}は、マッチング対象のブロックと、テンプレートとの適合度が高いほど値が小さくなる。 The difference absolute value sum fSAD [1] (i, j) {N} obtained by Expression 14 decreases as the matching degree between the matching target block and the template increases.
 例えば、上述したブロックB[1] (2,2)と、テンプレートT[1]{1}に関して、差分絶対値総和fSAD[1] (2,2){1}を求める場合には、マッチング処理部26は、ブロックB[1] (2,2) 内の任意の画素に対応する周波数特徴量f[1] (2,2)の値と、任意のテンプレートのブロック(テンプレートT[1]{1}=ブロックB[1] (1,1))内において、任意の画素に対応する位置の画素に対応する周波数特徴量fT[1]{1}の値との差分の絶対値を、ブロックB[1] (2,2) 内のすべての画素に対応する領域(=B[1] (2,2)の台)について求めて加算し、絶対値総和fSAD[1] (2,2){1}を求める。 For example, when the difference absolute value sum fSAD [1] (2,2) {1} is obtained for the block B [1] (2,2) and the template T [1] {1}, the matching process is performed. The unit 26 determines the value of the frequency feature quantity f [1] 2 (2,2) corresponding to an arbitrary pixel in the block B [1] (2,2) and an arbitrary template block (template T [1] { 1} = in block B [1] (1,1)), the absolute value of the difference from the value of the frequency feature quantity fT [1] {1} corresponding to the pixel at the position corresponding to an arbitrary pixel is The area corresponding to all the pixels in B [1] (2,2) ((= the base of B [1] (2,2)) is obtained and added, and the absolute value total fSAD [1] (2,2) Find {1}.
 マッチング処理部26は、同様の処理を、ブロックB[1] (2,2)と、テンプレートT[1]{2}~テンプレートT[1]{36}とのそれぞれについても行い、絶対値総和fSAD[1] (2,2){2}~絶対値総和fSAD[1] (2,2){36}を求める。そして、次式を用いて、ブロックB[1] (2,2)についての評価値fSAD[1] (2,2)を求める。 The matching processing unit 26 performs the same processing for each of the block B [1] (2,2) and the templates T [1] {2} to the templates T [1] {36}, and calculates the absolute value sum. fSAD [1] (2,2) {2} to absolute value sum fSAD [1] (2,2) {36} are obtained. Then, the evaluation value fSAD [1] (2,2) for the block B [1] (2,2) is obtained using the following equation.
Figure JPOXMLDOC01-appb-M000010
Figure JPOXMLDOC01-appb-M000010
 式15中右辺のmin(X)は、Xの最小値を返す式であり、上述の例では、絶対値総和fSAD[1] (2,2){1}~絶対値総和SAD[1] (2,2){36}の最小値を評価値fSAD[1] (2,2)とする。 The min (X) on the right side of Equation 15 is an equation that returns the minimum value of X. In the above example, the absolute value sum fSAD [1] (2,2) {1} to the absolute value sum SAD [1] ( 2,2) Let the minimum value of {36} be the evaluation value fSAD [1] (2,2).
 マッチング処理部26は、以上の処理を、ブロックB[1] (3,2)~ブロックB[1] (9,9)についても行い、それぞれ、評価値fSAD[1] (3,2)~評価値fSAD[1] (9,9)を求める。この結果、対象画像Img[1]中のマッチング対象のブロック(ブロックB[1] (2,2)~ブロックB[1] (9,9)の8×8=64ブロック)のそれぞれについて、評価値fSAD[1] (i,j)が求められる。 The matching processing unit 26 performs the above processing for the block B [1] (3,2) to the block B [1] (9,9), and the evaluation value fSAD [1] (3,2) ˜ The evaluation value fSAD [1] (9, 9) is obtained. As a result, each of the matching target blocks (8 × 8 = 64 blocks from block B [1] 8 (2,2) to block B [1] (9,9)) in the target image Img [1] is evaluated. The value fSAD [1] (i, j) is determined.
 また、マッチング処理部26は、同様の処理をローパス画像Img[2]およびImg[3]のそれぞれについても行い、ローパス画像Img[2]については、評価値fSAD[2] (2,2)~評価値SAD[2] (9,9)を求め、ローパス画像Img[3]については、評価値fSAD[3] (2,2)~評価値SAD[3] (9,9)を求める。 The matching processing unit 26 performs the same processing for each of the low-pass images Img [2] and Img [3]. For the low-pass image Img [2], the evaluation value fSAD [2] (2,2) ˜ Evaluation value SAD [2] (9,9) is obtained, and evaluation value fSAD [3] (2,2) to evaluation value SAD [3] (9,9) is obtained for the low-pass image Img [3].
 ステップS106以降の処理において、CPU14は、対象画像Img[1]については、評価値SAD[1] (2,2)~評価値SAD[1] (9,9)に代えて、評価値fSAD[1] (2,2)~評価値fSAD[1] (9,9)に基づいて、対象画像Img[1]に関するマップSal[1]を作成する。ローパス画像Img[2]およびImg[3]についても同様である。 In the processing after step S106, for the target image Img [1], the CPU 14 replaces the evaluation value SAD [1] (2,2) to the evaluation value SAD [1] (9,9) with the evaluation value fSAD [1]. 1] A map Sal [1] relating to the target image Img [1] is created based on (2,2) to evaluation value fSAD [1] (9,9). The same applies to the low-pass images Img [2] and Img [3].
 上記のように、第5実施形態の画像処理装置は、ブロック内に含まれる画素ごとの画素値を算出した後に、ブロック内に含まれる画素値に対してフーリエ変換を行うことにより代表値を算出する。そして、マッチング対象のブロック内の任意の代表値と、任意のテンプレートのブロック内において、任意の代表値に対応する代表値との差分の絶対値を、マッチング対象のブロック内のすべての画素に対応する代表値について求めて加算した値である差分絶対値総和を、複数のテンプレートのそれぞれについて求め、求めた複数の差分絶対値総和のうち、最小の前記差分絶対値総和の値を、マッチング対象のブロックに関する評価値とする。そのため、第1実施形態の構成とほぼ同様の効果を得ることができる。 As described above, the image processing apparatus according to the fifth embodiment calculates the representative value by performing the Fourier transform on the pixel value included in the block after calculating the pixel value for each pixel included in the block. To do. And, the absolute value of the difference between the arbitrary representative value in the matching target block and the representative value corresponding to the arbitrary representative value in the block of the arbitrary template corresponds to all the pixels in the matching target block. A sum of absolute differences, which is a value obtained by adding and obtaining a representative value, is obtained for each of a plurality of templates, and among the plurality of obtained sums of absolute differences, a value of the minimum sum of absolute differences is calculated as a matching target. The evaluation value for the block. Therefore, it is possible to obtain substantially the same effect as the configuration of the first embodiment.
 なお、第5実施形態においては、ステップS105において、フーリエ変換を行う例を示したが、周波数領域への画像変換であれば、どのような変換処理を行っても良い。例えば、離散コサイン変換や、ウェーブレット変換などを行っても良い。さらに、複数の方法を組み合わせて、周波数領域への画像変換を行っても良い。 In the fifth embodiment, an example in which Fourier transform is performed in step S105 has been described. However, any conversion process may be performed as long as image conversion to the frequency domain is performed. For example, discrete cosine transform or wavelet transform may be performed. Furthermore, image conversion to the frequency domain may be performed by combining a plurality of methods.
 また、第5実施形態においては、上述したように、求めた複数の差分絶対値総和のうち、最小の前記差分絶対値総和の値を、マッチング対象のブロックに関する評価値とする例を示したが、最大値や平均値を評価値としても良い。 Further, in the fifth embodiment, as described above, the example in which the smallest value of the difference absolute value sum among the obtained plurality of difference absolute value sums is used as the evaluation value for the block to be matched has been shown. The maximum value or the average value may be used as the evaluation value.
 <第6実施形態の説明>
 以下、第6実施形態の画像処理装置の動作例を説明する。第6実施形態は、上記した第5実施形態と同様に、第1実施形態から第4実施形態におけるS105の処理の変形例である。したがって、第5実施形態と同様に、本明細書では以下の実施形態の説明において、第1実施形態から第4実施形態と共通する画像処理装置の構成の重複説明は省略する。
<Description of Sixth Embodiment>
Hereinafter, an operation example of the image processing apparatus according to the sixth embodiment will be described. The sixth embodiment is a modification of the process of S105 in the first to fourth embodiments, similarly to the fifth embodiment described above. Therefore, as in the fifth embodiment, in the description of the following embodiments, the description of the configuration of the image processing apparatus common to the first to fourth embodiments is omitted in this specification.
 第6実施形態の例では、第1実施形態におけるS105の処理に代えて、以下の処理を行う。 In the example of the sixth embodiment, the following process is performed instead of the process of S105 in the first embodiment.
 (ステップS105)
 CPU14は、マッチング処理部26により、対象画像Img[1]、ローパス画像Img[2]およびImg[3]のそれぞれについて、マッチング処理を行う。
(Step S105)
The CPU 14 performs matching processing on each of the target image Img [1], the low-pass images Img [2], and Img [3] by the matching processing unit 26.
 以下では、対象画像Img[1]におけるマッチング処理を例に挙げて説明する。マッチング処理部26は、対象画像Img[1]について、ステップS103でブロック分割した各ブロック(ブロックB[1] (1,1)~ブロックB[1] (10,10))について、次式を用いて代表色特徴量を求める。なお、ステップS104で設定したテンプレートに対応するブロック(テンプレートT[1]{1}~テンプレートT[1]{36})については、式16を用いて代表色特徴量CL[1]{N}を求め、対象画像Img[1]から、ステップS104で設定したテンプレートを除く部分(ブロックB[1] (2,2)~ブロックB[1] (9,9)の8×8=64ブロック)のそれぞれについては、式17を用いて代表色特徴量CL[1] (i,j)を求める。 Hereinafter, the matching process in the target image Img [1] will be described as an example. The matching processing unit 26 calculates the following expression for each block (block B [1] (1,1) to block B [1] (10,10)) obtained by dividing the block in step S103 for the target image Img [1]. The representative color feature amount is obtained by using this. For the blocks (template T [1] {1} to template T [1] {36}) corresponding to the template set in step S104, the representative color feature CL [1] {N} And the portion excluding the template set in step S104 from the target image Img [1] (8 × 8 = 64 blocks from block B [1] (2,2) to block B [1] (9,9)) For each of the above, the representative color feature amount CL [1] (i, j) is obtained using Expression 17.
Figure JPOXMLDOC01-appb-M000011
Figure JPOXMLDOC01-appb-M000011
 式16中右辺のCLr[n]{N}、CLg[n]{N}、CLb[n]{N}は、それぞれ、テンプレートT[n]{N}内におけるRGB各色の画素値ごとの最頻値(モード)を示す。なお、最頻値が複数ある場合には、最も小さい画素値に対応する最頻値を採用しても良いし、平均値を採用しても良い。 CLr [n] {N}, CLg [n] {N}, and CLb [n] {N} on the right side of Equation 16 are respectively the maximum values for the pixel values of RGB colors in the template T [n] {N}. Indicates the mode value. When there are a plurality of mode values, the mode value corresponding to the smallest pixel value may be employed, or an average value may be employed.
 また、式17中右辺のCLr[n] (i,j)、CLg[n] (i,j)、CLb[n] (i,j)は、それぞれ、ブロックB[n] (i,j)内におけるRGB各色の画素値ごとの最頻値(モード)を示す。 Further, CLr [n] (i, j), CLg [n] (i, j), and CLb [n] (i, j) on the right side of Expression 17 are respectively represented by blocks B [n] (i, j). The mode value (mode) for each pixel value of each RGB color is shown.
 次に、マッチング処理部26は、対象画像Img[1]について、ステップS103でブロック分割した各ブロック(ブロックB[1] (1,1)~ブロックB[1] (10,10))について、次式を用いて第2代表色特徴量を求める。なお、ステップS104で設定したテンプレートに対応するブロック(テンプレートT[1]{1}~テンプレートT[1]{36})については、式18~式21を用いて第2代表色特徴量Q[1]{N}を求め、対象画像Img[1]から、ステップS104で設定したテンプレートを除く部分(ブロックB[1] (2,2)~ブロックB[1] (9,9)の8×8=64ブロック)のそれぞれについては、式22~式25を用いて第2代表色特徴量Q[1] (i,j)を求める。 Next, for the target image Img [1], the matching processing unit 26 performs block division on each block (block B [1] 1 , (1,1) to block B [1] (10,10)) in step S103. A second representative color feature amount is obtained using the following equation. For the blocks (template T [1] {1} to template T [1] {36}) corresponding to the template set in step S104, the second representative color feature value Q [ 1] {N} is obtained, and the portion excluding the template set in step S104 from the target image Img [1] (block B [1] (2,2) to block B [1] (9,9) 8 × For each of (8 = 64 blocks), the second representative color feature value Q [1] (i, j) is obtained using Equations 22 to 25.
Figure JPOXMLDOC01-appb-M000012
Figure JPOXMLDOC01-appb-M000012
 式19中右辺のPr[n]{N}は、テンプレートT[n]{N}内におけるR成分の相対ヒストグラムを示す。同様に、式20中右辺のPg[n]{N}は、テンプレートT[n]{N}内におけるG成分の相対ヒストグラムを示し、式21中右辺のPb[n]{N}は、テンプレートT[n]{N}内におけるB成分の相対ヒストグラムを示す。また、式23中右辺のPr[n] (i,j)は、ブロックB[n] (i,j)内におけるR成分の相対ヒストグラムを示す。同様に、式24中右辺のPg[n] (i,j)は、ブロックB[n] (i,j)内におけるG成分の相対ヒストグラムを示し、式25中右辺のPb[n] (i,j)は、ブロックB[n] (i,j)内におけるB成分の相対ヒストグラムを示す。また、式19~式21および式23~式25において、和を表すΣを求める範囲は、各相対ヒストグラムのbin数(分割数)によって決まる。 Pr [n] {N} on the right side of Equation 19 represents a relative histogram of the R component in the template T [n] {N}. Similarly, Pg [n] {N} on the right side in Expression 20 represents a relative histogram of the G component in the template T [n] {N}, and Pb [n] {N} on the right side in Expression 21 represents the template. The relative histogram of the B component in T [n] {N} is shown. In addition, Pr [n] (i, j) on the right side of Equation 23 represents a relative histogram of the R component in the block B [n] (i, j). Similarly, Pg [n] (i, j) on the right side in Expression 24 represents a relative histogram of the G component in the block B [n] (i, j), and Pb [n] (i on the right side in Expression 25. , J) shows a relative histogram of the B component in the block B [n] (i, j). In Equations 19 to 21 and 23 to 25, the range for obtaining Σ representing the sum is determined by the number of bins (number of divisions) in each relative histogram.
 マッチング処理部26は、代表色特徴量CL[1]{1}~代表色特徴量CLf[1]{36}および代表色特徴量CL[1] (2,2) ~代表色特徴量CL[1] (9,9)をそれぞれ求めるとともに、第2代表色特徴量Q[1]{1}~第2代表色特徴量Q[1]{36}および、第2代表色特徴量Q[1] (2,2) ~第2代表色特徴量Q[1] (9,9)をそれぞれ求める。そして、対象画像Img[1]から、ステップS104で設定したテンプレートを除く部分のそれぞれについて、ブロックごとに評価値V[1] (i,j)を求める。 The matching processing unit 26 represents the representative color feature value CL [1] {1} to the representative color feature value CLf [1] {36} and the representative color feature value CL [1] (2,2) to the representative color feature value CL [ 1] (9, 9) is obtained, and the second representative color feature value Q [1] {1} to the second representative color feature value Q [1] {36} and the second representative color feature value Q [1 ] (2,2) to second representative color feature quantity Q [1] (9,9) are obtained. Then, an evaluation value V [1] (i, j) is obtained for each block from the target image Img [1] for each portion excluding the template set in step S104.
 一例として、マッチング対象のブロックのうち、ブロックB[1] (2,2)について、評価値V[1] (2,2)を求める場合を例に挙げる。マッチング処理部26は、ブロックB[1] (2,2)の代表色特徴量CL[1] (2,2)および第2代表色特徴量Q[1] (2,2)と、ステップS104で設定したテンプレート(テンプレートT[1]{1}~テンプレートT[1]{36})の代表色特徴量CL[1]{1}~代表色特徴量CLf[1]{36}および第2代表色特徴量Q[1]{1}~第2代表色特徴量Q[1]{36}とをそれぞれ比較し、次式に示す差分絶対値総和V[1] (i,j){N}を求める。 As an example, a case where the evaluation value V [1] (2,2) is obtained for the block B [1] (2,2) among the blocks to be matched will be described as an example. The matching processing unit 26 performs representative color feature value CL [1] (2,2) and second representative color feature value Q [1] (2,2) of block B [1] (2,2), and step S104. The representative color feature values CL [1] {1} to the representative color feature values CLf [1] {36} of the templates (template T [1] {1} to template T [1] {36}) set in step 2 The representative color feature quantity Q [1] {1} to the second representative color feature quantity Q [1] {36} are respectively compared, and the difference absolute value sum V [1] (i, j) {N }
Figure JPOXMLDOC01-appb-M000013
Figure JPOXMLDOC01-appb-M000013
 式26中左辺の[n]は画像の種類(ここではn=1)を示し、(i,j)はブロックの位置(ここでは、i=2,j=2)を示し、{N}はテンプレートの番号(ここでは1~36)を示す。また、式26中右辺は、マッチング処理の対象のブロック(ブロックB[n] (i,j))の各特徴量と、任意のテンプレートのブロック(テンプレートT[n]{N}))の各特徴量との差分の絶対値をそれぞれ求め、加算することを示す。 [N] on the left side of Equation 26 indicates the type of image (here, n = 1), (i, j) indicates the position of the block (here, i = 2, j = 2), and {N} Indicates the template number (here, 1 to 36). Further, the right side in Expression 26 represents each feature amount of the block (block B [n] (i, j)) to be matched and each block of the template (template T [n] {N})). It shows that the absolute value of the difference from the feature amount is obtained and added.
 式26で求まる差分絶対値総和V[1] (i,j){N}は、マッチング対象のブロックと、テンプレートとの適合度が高いほど値が小さくなる。 The difference absolute value sum V [1] (i, j) {N} obtained by Expression 26 decreases as the matching degree between the matching target block and the template increases.
 マッチング処理部26は、同様の処理を、ブロックB[1] (2,2)と、テンプレートT[1]{2}~テンプレートT[1]{36}とのそれぞれについても行い、絶対値総和V[1] (2,2){2}~絶対値総和V[1] (2,2){36}を求める。そして、次式を用いて、ブロックB[1] (2,2)についての評価値V[1] (2,2)を求める。 The matching processing unit 26 performs the same processing for each of the block B [1] (2,2) and the templates T [1] {2} to the templates T [1] {36}, and calculates the absolute value sum. V [1] (2,2) {2} to absolute value sum V [1] (2,2) {36} are obtained. Then, an evaluation value V [1] (2,2) for the block B [1] (2,2) is obtained using the following equation.
Figure JPOXMLDOC01-appb-M000014
Figure JPOXMLDOC01-appb-M000014
 式27中右辺のmin(X)は、Xの最小値を返す式であり、上述の例では、絶対値総和V[1] (2,2){1}~絶対値総和V[1] (2,2){36}の最小値を評価値V[1] (2,2)とする。 Min (X) on the right side of Expression 27 is an expression that returns the minimum value of X. In the above example, the sum of absolute values V [1] (2,2) {1} to the sum of absolute values V [1] ( 2,2) Let the minimum value of {36} be the evaluation value V [1] (2,2).
 マッチング処理部26は、以上の処理を、ブロックB[1] (3,2)~ブロックB[1] (9,9)についても行い、それぞれ、評価値V[1] (3,2)~評価値V[1] (9,9)を求める。この結果、対象画像Img[1]中のマッチング対象のブロック(ブロックB[1] (2,2)~ブロックB[1] (9,9)の8×8=64ブロック)のそれぞれについて、評価値V [1] (i,j)が求められる。 The matching processing unit 26 performs the above processing also for the block B [1] (3,2) to the block B [1] , (9,9), and the evaluation value V [1] (3,2) ˜ The evaluation value V [1] (9, 9) is obtained. As a result, each of the matching target blocks (8 × 8 = 64 blocks from block B [1] 8 (2,2) to block B [1] (9,9)) in the target image Img [1] is evaluated. The value V [1] (i, j) is determined.
 また、マッチング処理部26は、同様の処理をローパス画像Img[2]およびImg[3]のそれぞれについても行い、ローパス画像Img[2]については、評価値V[2] (2,2)~評価値V[2] (9,9)を求め、ローパス画像Img[3]については、評価値V[3] (2,2)~評価値V[3] (9,9)を求める。 The matching processing unit 26 performs the same processing for each of the low-pass images Img [2] and Img [3]. For the low-pass image Img [2], the evaluation value V [2] (2, 2) ˜ Evaluation value V [2] (9,9) is obtained, and evaluation value V [3] (2,2) to evaluation value V [3] (9,9) is obtained for the low-pass image Img [3].
 ステップS106以降の処理において、CPU14は、対象画像Img[1]については、評価値SAD[1] (2,2)~評価値SAD[1] (9,9)に代えて、評価値V[1] (2,2)~評価値V[1] (9,9)に基づいて、対象画像Img[1]に関するマップSal[1]を作成する。ローパス画像Img[2]およびImg[3]についても同様である。 In the processing after step S106, the CPU 14 replaces the evaluation value SAD [1] (2,2) to the evaluation value SAD [1] (9,9) with respect to the target image Img [1]. 1] A map Sal [1] relating to the target image Img [1] is created based on (2,2) to evaluation value V [1] (9,9). The same applies to the low-pass images Img [2] and Img [3].
 上記のように、第6実施形態の画像処理装置は、代表値として、対象画像を構成する複数の色成分の分布に基づいて、色に関する特徴を示す値を、複数のブロックごとに算出する。そして、マッチング対象のブロックの代表値と、任意のテンプレートのブロックの代表値との差分を加算した値である差分絶対値総和を、複数のテンプレートのそれぞれについて求め、求めた複数の差分絶対値総和のうち、最小の差分絶対値総和の値を、マッチング対象のブロックに関する評価値とする。そのため、第1実施形態の構成とほぼ同様の効果を得ることができる。 As described above, the image processing apparatus according to the sixth embodiment calculates, as a representative value, a value indicating a color feature for each of a plurality of blocks based on a distribution of a plurality of color components constituting the target image. Then, a difference absolute value sum that is a value obtained by adding the difference between the representative value of the block to be matched and the representative value of the block of an arbitrary template is obtained for each of the plurality of templates, and the obtained plurality of difference absolute value sums are obtained. Among these, the smallest sum of absolute differences is set as the evaluation value for the block to be matched. Therefore, it is possible to obtain substantially the same effect as the configuration of the first embodiment.
 なお、第6実施形態では、色に関する特徴を示す値として、代表色特徴量および第2代表色特徴量を例に挙げて説明したが、いずれか一方のみを用いても良い。また、式26において示した差分絶対値総和V[n] (i,j){N}を求める際には、代表色特徴量および第2代表色特徴量に適宜重み付けを行っても良い。 In the sixth embodiment, the representative color feature value and the second representative color feature value have been described as examples of the value indicating the color feature, but only one of them may be used. Further, when the difference absolute value sum V [n] (i, j) {N} shown in Expression 26 is obtained, the representative color feature value and the second representative color feature value may be appropriately weighted.
 <第6実施形態の変形例の説明>
 なお、第6実施形態のS103からステップS105の処理を、以下のように変形しても良い。
<Description of Modified Example of Sixth Embodiment>
Note that the processing from S103 to S105 of the sixth embodiment may be modified as follows.
 (ステップS103)
 CPU14は、領域分割部24により、ステップS101で取得した対象画像Img[1]、ステップS102で生成したローパス画像Img[2]およびImg[3]を、それぞれ、複数のブロックに分割する。ただし、領域分割部24は、図11に示すように、対象画像Img[1]を、外周に存在するブロックB[1] (1,1)と、その内側に存在する8×8のマトリクス状のブロックB[1] (2,2)~B[1] (9,9)とに分割する。また、領域分割部24は、ローパス画像Img[2]およびImg[3]についても同様に分割する。
(Step S103)
The CPU 14 divides the target image Img [1] acquired in step S101 and the low-pass images Img [2] and Img [3] generated in step S102 into a plurality of blocks by the area dividing unit 24, respectively. However, as shown in FIG. 11, the area dividing unit 24 divides the target image Img [1] into a block B [1] (1, 1) existing on the outer periphery and an 8 × 8 matrix shape existing inside the block B [1] (1, 1). Are divided into blocks B [1] (2, 2) to B [1] (9, 9). Further, the region dividing unit 24 similarly divides the low-pass images Img [2] and Img [3].
 (ステップS104)
 CPU14は、テンプレート設定部25により、S103の分割処理による複数のブロックから、外周に存在するブロックB[1] (1,1)を選択し、テンプレートとして設定する。テンプレート設定部25は、図12に示すように、テンプレートの設定を対象画像Img[1]、ローパス画像Img[2]およびImg[3]のそれぞれについて行う。つまり、この変形例において、テンプレート設定部25は、1つのブロックをテンプレートT[1]{1}として設定する。
(Step S104)
The CPU 14 uses the template setting unit 25 to select the block B [1] (1, 1) existing on the outer periphery from the plurality of blocks obtained by the division processing in S103, and sets it as a template. As shown in FIG. 12, the template setting unit 25 sets a template for each of the target image Img [1], the low-pass images Img [2], and Img [3]. That is, in this modification, the template setting unit 25 sets one block as the template T [1] {1}.
 (ステップS105)
 CPU14は、マッチング処理部26により、対象画像Img[1]、ローパス画像Img[2]およびImg[3]のそれぞれについて、マッチング処理を行う。
(Step S105)
The CPU 14 performs matching processing on each of the target image Img [1], the low-pass images Img [2], and Img [3] by the matching processing unit 26.
 以下では、対象画像Img[1]におけるマッチング処理を例に挙げて説明する。マッチング処理部26は、対象画像Img[1]について、ステップS103でブロック分割した各ブロック(ブロックB[1] (1,1),B[1] (2,2)~ブロックB[1] (9,9))について、上述した代表色特徴量を求める。また、ステップS104で設定したテンプレートに対応するブロック(テンプレートT[1]{1})について、上述した代表色特徴量CL[1]{1}を求め、対象画像Img[1]から、ステップS104で設定したテンプレートを除く部分(ブロックB[1] (2,2)~ブロックB[1] (9,9)の8×8=64ブロック)のそれぞれについて、上述した代表色特徴量CL[1] (i,j)を求める。 Hereinafter, the matching process in the target image Img [1] will be described as an example. The matching processing unit 26 blocks each block (block B [1] (1,1), B [1] (2,2) to block B [1] (block B [1] (1,2)) for the target image Img [1] in step S103. For 9, 9)), the representative color feature amount described above is obtained. In addition, for the block (template T [1] {1}) corresponding to the template set in step S104, the representative color feature amount CL [1] {1} described above is obtained, and from the target image Img [1], step S104 is obtained. The representative color feature amount CL [1 described above for each of the portions (8 × 8 = 64 blocks from block B [1] (2,2) to block B [1] (9,9)) excluding the template set in step 1). ] Find (i, j).
 次に、マッチング処理部26は、対象画像Img[1]について、ステップS103でブロック分割した各ブロック(ブロックB[1] (1,1) ,B[1] (2,2)~ブロックB[1] (9,9))について、上述した第2代表色特徴量を求める。なお、ステップS104で設定したテンプレートに対応するブロック(テンプレートT[1]{1})については、上述した第2代表色特徴量Q[1]{1}を求め、対象画像Img[1]から、ステップS104で設定したテンプレートを除く部分(ブロックB[1] (2,2)~ブロックB[1] (9,9)の8×8=64ブロック)のそれぞれについては、上述した第2代表色特徴量Q[1] (i,j)を求める。 Next, the matching processing unit 26 blocks each block (block B [1] (1,1), B [1] (2,2) to block B [) divided in step S103 for the target image Img [1]. 1] The above-mentioned second representative color feature amount is obtained for (9, 9)). For the block (template T [1] {1}) corresponding to the template set in step S104, the above-described second representative color feature quantity Q [1] {1} is obtained, and the target image Img [1] is obtained. Each of the portions excluding the template set in step S104 (8 × 8 = 64 blocks from block B [1] (2,2) to block B [1] (9,9)) is the second representative described above. A color feature quantity Q [1] (i, j) is obtained.
 マッチング処理部26は、代表色特徴量CL[1]{1}および代表色特徴量CL[1] (2,2) ~代表色特徴量CL[1] (9,9)をそれぞれ求めるとともに、第2代表色特徴量Q[1]{1}および、第2代表色特徴量Q[1] (2,2) ~第2代表色特徴量Q[1] (9,9)をそれぞれ求める。そして、対象画像Img[1]から、ステップS104で設定したテンプレートを除く部分のそれぞれについて、ブロックごとに評価値V[1] (i,j)を求める。 The matching processing unit 26 obtains the representative color feature value CL [1] {1} and the representative color feature value CL [1] (2,2) to the representative color feature value CL [1] (9,9), respectively. The second representative color feature value Q [1] {1} and the second representative color feature value Q [1] (2,2) to the second representative color feature value Q [1] (9,9) are obtained. Then, an evaluation value V [1] (i, j) is obtained for each block from the target image Img [1] for each portion excluding the template set in step S104.
 一例として、マッチング対象のブロックのうち、ブロックB[1] (2,2)について、評価値V[1] (2,2)を求める場合を例に挙げる。マッチング処理部26は、ブロックB[1] (2,2)の代表色特徴量CL[1] (2,2)および第2代表色特徴量Q[1] (2,2)と、ステップS104で設定したテンプレート(テンプレートT[1]{1})の代表色特徴量CL[1]{1}および第2代表色特徴量Q[1]{1}とをそれぞれ比較し、上述した差分絶対値総和V[1] (2,2){1}を求める。 As an example, a case where the evaluation value V [1] (2,2) is obtained for the block B [1] (2,2) among the blocks to be matched will be described as an example. The matching processing unit 26 performs representative color feature value CL [1] (2,2) and second representative color feature value Q [1] (2,2) of block B [1] (2,2), and step S104. Are compared with the representative color feature value CL [1] {1} and the second representative color feature value Q [1] {1} of the template (template T [1] {1}) set in step 1, respectively. The value sum V [1] (2,2) {1} is obtained.
 マッチング処理部26は、以上の処理を、ブロックB[1] (3,2)~ブロックB[1] (9,9)についても行い、それぞれ、評価値V[1] (3,2)~評価値V[1] (9,9)を求める。この結果、対象画像Img[1]中のマッチング対象のブロック(ブロックB[1] (2,2)~ブロックB[1] (9,9)の8×8=64ブロック)のそれぞれについて、評価値V [1] (i,j)が求められる。 The matching processing unit 26 performs the above processing also for the block B [1] (3,2) to the block B [1] , (9,9), and the evaluation value V [1] (3,2) ˜ The evaluation value V [1] (9, 9) is obtained. As a result, each of the matching target blocks (8 × 8 = 64 blocks from block B [1] 8 (2,2) to block B [1] (9,9)) in the target image Img [1] is evaluated. The value V [1] (i, j) is determined.
 また、マッチング処理部26は、同様の処理をローパス画像Img[2]およびImg[3]のそれぞれについても行い、ローパス画像Img[2]については、評価値V[2] (2,2)~評価値V[2] (9,9)を求め、ローパス画像Img[3]については、評価値V[3] (2,2)~評価値V[3] (9,9)を求める。 The matching processing unit 26 performs the same processing for each of the low-pass images Img [2] and Img [3]. For the low-pass image Img [2], the evaluation value V [2] (2, 2) ˜ Evaluation value V [2] (9,9) is obtained, and evaluation value V [3] (2,2) to evaluation value V [3] (9,9) is obtained for the low-pass image Img [3].
 以上説明したように、対象画像Img[1]を等分割でなく分割し、分割の結果、唯一のテンプレートとなるブロックB[1] (1,1)を、テンプレートT[1]{1}として設定する構成としても良い。この場合も、第6実施形態と同様の効果を得ることができる。 As described above, the target image Img [1] is divided instead of equally divided, and the block B [1] (1,1) which is the only template as a result of the division is defined as the template T [1] {1}. It is good also as a structure to set. In this case, the same effect as that of the sixth embodiment can be obtained.
 なお、図11に示した分割例および図12に示したテンプレートの設定例は一例であり、本発明はこの例に限定されない。分割は、どのような形状で行っても良いし、複数のブロックの画像に基づいてテンプレートを設定しても良い。 It should be noted that the division example shown in FIG. 11 and the template setting example shown in FIG. 12 are examples, and the present invention is not limited to this example. The division may be performed in any shape, and a template may be set based on a plurality of block images.
 <第7実施形態の説明>
 以下、第7実施形態の画像処理装置の動作例を説明する。第7実施形態は、第1実施形態から第6実施形態におけるマップの作成の変形例である。したがって、本明細書では以下の実施形態の説明において、第1実施形態から第6実施形態と共通する画像処理装置の構成の重複説明は省略する。
<Description of Seventh Embodiment>
Hereinafter, an operation example of the image processing apparatus according to the seventh embodiment will be described. The seventh embodiment is a modification of map creation in the first to sixth embodiments. Therefore, in the present specification, in the description of the following embodiments, the redundant description of the configuration of the image processing apparatus that is common to the first to sixth embodiments is omitted.
 第7実施形態の例では、第1実施形態から第6実施形態におけるマップの作成処理において、テンプレートを追加する処理を行う。 In the example of the seventh embodiment, a process for adding a template is performed in the map creation process in the first to sixth embodiments.
 図13は、第1実施形態の図2に示したフローチャートの変形例を示すフローチャートである。
(ステップS201~ステップS206)
 CPU14は、図2に示したフローチャートのステップS101~ステップS106と同様の処理を行う。
(ステップS207)
 CPU14は、ステップS206で求めたマップSal[T]に基づいて、追加するテンプレートがあるか否かを判定する。CPU14は、追加するテンプレートありと判定すると、ステップS204に戻り、再びテンプレートの設定を行う。一方、CPU14は、追加するテンプレートなしと判定すると、ステップS208に進む。
FIG. 13 is a flowchart showing a modification of the flowchart shown in FIG. 2 of the first embodiment.
(Step S201 to Step S206)
The CPU 14 performs the same processing as steps S101 to S106 in the flowchart shown in FIG.
(Step S207)
The CPU 14 determines whether or not there is a template to be added based on the map Sal [T] obtained in step S206. When determining that there is a template to be added, the CPU 14 returns to step S204 and sets the template again. On the other hand, when determining that there is no template to be added, the CPU 14 proceeds to step S208.
 CPU14は、ステップS203の分割処理による複数のブロックのうち、テンプレートに設定されていないブロックについて、マップSal[T]の各画素の値の代表値を求める。代表値は、平均値や中央値等どのような方法で求めても良い。そして、求めた代表値が、所定の閾値より小さいブロックがある場合には、追加するテンプレートありと判定する。代表値が、所定の閾値より小さいブロックとは、背景領域であると推測できるブロックであるしたがって、このようなブロックをテンプレートとして追加することにより、より精度の良いマップを作成することができる。 CPU14 calculates | requires the representative value of the value of each pixel of map Sal [T] about the block which is not set to the template among the several blocks by the division | segmentation process of step S203. The representative value may be obtained by any method such as an average value or a median value. Then, if there is a block whose calculated representative value is smaller than a predetermined threshold, it is determined that there is a template to be added. A block whose representative value is smaller than a predetermined threshold is a block that can be assumed to be a background area. Therefore, a map with higher accuracy can be created by adding such a block as a template.
 CPU14は、追加するテンプレートなしと判定されるまで、ステップS204からステップS207の処理を繰り返す。このような処理を繰り返すことにより、結果として、外周部でない部分(=中央に近い部分)の各ブロックがテンプレートとして設定される場合もある。そのため、主要被写体領域が中心にない構図の対象画像であっても、適切にテンプレートを設定し、精度の良いマップを作成することができる。 CPU14 repeats the process of step S204 to step S207 until it determines with there being no template to add. By repeating such a process, as a result, each block of a portion that is not an outer peripheral portion (= portion close to the center) may be set as a template. Therefore, a template can be set appropriately and a highly accurate map can be created even for a target image having a composition in which the main subject region is not centered.
 また、例えば、対象画像の背景部分にグラデーションがかかっている場合にも、テンプレートの追加は有用である。背景部分の外側から内側に向かって色が薄くなる(または明るくなる)グラデーションがかかっている場合、中央に近いブロック程、外周部分に存在するブロックとの差異が出やすくなる。したがって、これらのブロックはマップの値が大きくなるため、主要被写体領域として検出されてしまう可能性が高い。しかし、上述したように、テンプレートの追加を行う場合、差異の少ない隣接するブロックが徐々にテンプレートとして追加されるので、背景領域である部分に存在するブロックを、確実にテンプレートに設定することができる。 Also, for example, adding a template is useful when the background of the target image has a gradation. When a gradation is applied in which the color becomes lighter (or lighter) from the outside to the inside of the background portion, the block closer to the center is more likely to be different from the block existing in the outer peripheral portion. Therefore, since these blocks have large map values, there is a high possibility that these blocks will be detected as main subject areas. However, as described above, when adding a template, adjacent blocks with little difference are gradually added as a template, so that a block existing in a portion that is a background region can be reliably set as a template. .
 なお、特許4334981号の発明では、画像の周辺部分を背景テンプレートとして選択し、各ブロックの物理的な距離による重み付けをすることで、画像の内側の背景も正確に検出する技術が開示されている。しかし、上記の発明では、物理的な距離による重み付けに起因して、主要被写体領域についても、中央部分に近くなるほど、背景領域として検出されやすい傾向がある。これに対して、上述したテンプレートを追加する方法によれば、物理的な距離よる重み付けを用いないため、主要被写体の物理的な位置に関係なく、その部分がテンプレートとして設定されたブロックに対応する部分と似ていなければ背景領域として検出される可能性は低い。
(ステップS208~ステップS209)
 CPU14は、図2に示したフローチャートのステップS107~ステップS108と同様の処理を行う。
In the invention of Japanese Patent No. 4334981, a technique for accurately detecting the background inside the image by selecting a peripheral portion of the image as a background template and weighting by the physical distance of each block is disclosed. . However, in the above invention, due to the weighting by the physical distance, the main subject region also tends to be detected as the background region closer to the central portion. On the other hand, according to the method of adding a template described above, weighting based on a physical distance is not used, so that the portion corresponds to a block set as a template regardless of the physical position of the main subject. If it does not resemble the part, the possibility of being detected as a background region is low.
(Step S208 to Step S209)
The CPU 14 performs the same processing as steps S107 to S108 in the flowchart shown in FIG.
 以上説明したように、テンプレートの追加を行うことにより、より精度の高いマップを作成することができる。 As described above, a map with higher accuracy can be created by adding a template.
 <第8実施形態の説明>
 図14は、第8実施形態での電子カメラの構成例を示すブロック図である。電子カメラ31は、撮像光学系32と、撮像素子33と、画像処理エンジン34と、ROM35と、メインメモリ36と、記録I/F37と、ユーザの操作を受け付ける操作部38と、不図示のモニタを備えた表示部39を有している。ここで、撮像素子33、ROM35、メインメモリ36、記録I/F37、操作部38および表示部39は、それぞれ画像処理エンジン34に接続されている。
<Description of Eighth Embodiment>
FIG. 14 is a block diagram illustrating a configuration example of an electronic camera according to the eighth embodiment. The electronic camera 31 includes an imaging optical system 32, an imaging device 33, an image processing engine 34, a ROM 35, a main memory 36, a recording I / F 37, an operation unit 38 that receives user operations, and a monitor (not shown). It has the display part 39 provided with. Here, the image sensor 33, ROM 35, main memory 36, recording I / F 37, operation unit 38 and display unit 39 are each connected to the image processing engine 34.
 撮像素子33は、撮像光学系32によって結像される被写体の像を撮像し、撮像した画像の画像信号を生成する撮像デバイスである。なお、撮像素子33から出力された画像信号は、A/D変換回路(不図示)を介して制御部に入力される。 The imaging element 33 is an imaging device that captures an image of a subject formed by the imaging optical system 32 and generates an image signal of the captured image. The image signal output from the image sensor 33 is input to the control unit via an A / D conversion circuit (not shown).
 画像処理エンジン34は、電子カメラ31の動作を統括的に制御するプロセッサである。例えば、画像処理エンジン34は、撮像した画像のデータに対して各種の画像処理(色補間処理、階調変換処理、輪郭強調処理、ホワイトバランス調整、色変換処理など)を施す。また、画像処理エンジン34は、プログラムの実行により、上記した第1実施形態から第7実施形態のいずれかの画像処理装置(CPU14、ローパス画像生成部23、領域分割部24、テンプレート設定部25、マッチング処理部26、マップ作成部27)として機能する。 The image processing engine 34 is a processor that comprehensively controls the operation of the electronic camera 31. For example, the image processing engine 34 performs various types of image processing (color interpolation processing, gradation conversion processing, contour enhancement processing, white balance adjustment, color conversion processing, etc.) on the captured image data. Further, the image processing engine 34 is configured to execute any one of the image processing apparatuses (the CPU 14, the low-pass image generation unit 23, the region division unit 24, the template setting unit 25, and the like) according to the first to seventh embodiments by executing a program. It functions as a matching processing unit 26 and a map creation unit 27).
 ROM35には、画像処理エンジン34によって実行されるプログラムが記憶されている。また、メインメモリ36は、画像処理の前工程や後工程で画像のデータを一時的に記憶する。 The ROM 35 stores a program executed by the image processing engine 34. The main memory 36 temporarily stores image data in the pre-process and post-process of image processing.
 記録I/F37は、不揮発性の記憶媒体40を接続するためのコネクタを有している。そして、記録I/F37は、コネクタに接続された記憶媒体40に対してデータの書き込み/読み込みを実行する。上記の記憶媒体40は、ハードディスクや、半導体メモリを内蔵したメモリカードなどで構成される。なお、図14では記憶媒体40の一例としてメモリカードを図示する。 The recording I / F 37 has a connector for connecting the nonvolatile storage medium 40. Then, the recording I / F 37 executes data writing / reading with respect to the storage medium 40 connected to the connector. The storage medium 40 is composed of a hard disk, a memory card incorporating a semiconductor memory, or the like. In FIG. 14, a memory card is illustrated as an example of the storage medium 40.
 表示部39は、画像処理エンジン34から取得した画像データを表示するとともに、第1実施形態のステップS108で説明した表示を行う。 The display unit 39 displays the image data acquired from the image processing engine 34 and the display described in step S108 of the first embodiment.
 第8実施形態の電子カメラ31は、ユーザの撮像指示をトリガとする撮像工程において、撮像素子33で撮像された画像を対象画像として取得し、上記実施形態のいずれかの画像処理装置と同様の処理によりマップSal[T]を作成する。なお、画像処理エンジン34は、対象画像のデータを含む画像ファイルに、マップSal[T]を付帯情報として記録してもよい。また、メインメモリ36などに記録された画像を対象画像として、同様の処理を行っても良い。以上により、第8実施形態の電子カメラ31は、上記実施形態とほぼ同様の効果を得ることができる。 The electronic camera 31 of the eighth embodiment acquires an image captured by the image sensor 33 as a target image in an imaging process triggered by a user's imaging instruction, and is the same as the image processing apparatus of any of the above embodiments. A map Sal [T] is created by processing. Note that the image processing engine 34 may record the map Sal [T] as supplementary information in an image file including data of the target image. Further, the same processing may be performed using an image recorded in the main memory 36 or the like as a target image. As described above, the electronic camera 31 of the eighth embodiment can obtain substantially the same effect as that of the above embodiment.
 <実施形態の補足事項>
 (1)上記各実施形態では対象画像のデータがRGB形式である例を説明したが、本発明は上記実施形態の構成に限定されるものではない。本発明の画像処理装置は、例えばYCbCr色空間やL色空間などの他の色空間の画像データについても適用することができる。
<Supplementary items of the embodiment>
(1) In each of the above embodiments, the example in which the target image data is in the RGB format has been described. However, the present invention is not limited to the configuration of the above embodiment. The image processing apparatus of the present invention can also be applied to image data in other color spaces such as YCbCr color space and L * a * b * color space.
 (2)上記各実施形態で説明した各変数、係数、閾値などは一例であり本発明はこの例に限定されない。例えば、第1実施形態のステップS103におけるブロック分割は10×10で行う例を示しが、他の分割数であっても良い。 (2) Each variable, coefficient, threshold value, and the like described in the above embodiments is an example, and the present invention is not limited to this example. For example, the block division in step S103 of the first embodiment is an example of 10 × 10, but other division numbers may be used.
 また、例えば、第1実施形態のステップS103におけるブロック分割は、10×10の領域に重なり部分が発生しないように行う例を示したが、重なり部分を有するように分割を行っても良い。重なり部分が発生しない場合には、主要被写体領域が複数のブロックにまたがって存在すると、マップの精度が低下するおそれがある。そこで、オーバーラップする部分を含めて分割を行うことにより、主要被写体領域が複数のブロックにまたがって存在する場合でも、マップの精度を向上させることが期待できる。さらに、中央部分などを主要被写体領域と見なすことにより、一部の領域を初めから除外してブロック分割を行っても良い。 In addition, for example, the block division in step S103 of the first embodiment has been described so as not to generate an overlapping portion in a 10 × 10 region, but the division may be performed so as to have an overlapping portion. If the overlapping portion does not occur, the accuracy of the map may be lowered if the main subject region exists across a plurality of blocks. Therefore, by performing the division including the overlapping portion, it can be expected that the accuracy of the map is improved even when the main subject region exists over a plurality of blocks. Furthermore, block division may be performed by excluding a part of the region from the beginning by regarding the central portion as the main subject region.
 (3)上記各実施形態では、図6に示したように、主要被写体領域が1つである場合を例に挙げて説明したが、本発明はこの例に限定されない。例えば、図15Aに示す対象画像Img[1]について、上記各実施形態で説明した処理を行うことにより、図15Bに示すマップSal[T]を作成することができる。このような場合、作成したマップSal[T]に基づいて、主要被写体領域の抽出を行うと、図16Aに示すように、マップSal[T]において複数の主要被写体領域を抽出することができる。さらに、図16Bに示すように、対象画像Img[1]において、複数の主要被写体領域を抽出することができる。なお、複数の主要被写体領域を抽出する場合には、公知のラベリング技術やクラスタリングによるグループ化処理などを用いることにより、複数の主要被写体領域を分けて認識することができる。 (3) In each of the above embodiments, as shown in FIG. 6, the case where there is one main subject region has been described as an example, but the present invention is not limited to this example. For example, the map Sal [T] shown in FIG. 15B can be created by performing the processing described in the above embodiments on the target image Img [1] shown in FIG. 15A. In such a case, if a main subject area is extracted based on the created map Sal [T], a plurality of main subject areas can be extracted from the map Sal [T] as shown in FIG. 16A. Furthermore, as shown in FIG. 16B, a plurality of main subject areas can be extracted from the target image Img [1]. When a plurality of main subject areas are extracted, the plurality of main subject areas can be recognized separately by using a known labeling technique or grouping processing by clustering.
 上述したように、複数の主要被写体領域を抽出した場合、複数の主要被写体領域の何れかを選択するか、複数の主要被写体領域の情報を総合して、上記各実施形態で説明した処理を各主要被写体領域ごとに行えば良い。 As described above, when a plurality of main subject areas are extracted, either one of the plurality of main subject areas is selected or information on the plurality of main subject areas is combined to perform the processing described in each of the above embodiments. This may be done for each main subject area.
 複数の主要被写体領域の何れかを選択する場合には、例えば、面積の大きい主要被写体領域を選択する方法や、その主要被写体領域を構成する画素に対応するマップの値の総和の高い主要被写体領域を選択する方法などが考えられる。逆に、上述したマップの値の総和の低い主要被写体領域や面積の小さい主要被写体領域を除外することで、ノイズに相当する部分を削除できる可能性が高まる。また、複数の主要被写体領域の何れかをユーザ操作に基づいて選択する構成としても良い。 When selecting one of a plurality of main subject areas, for example, a method of selecting a main subject area having a large area, or a main subject area having a high sum of map values corresponding to pixels constituting the main subject area. The method of selecting can be considered. Conversely, by excluding the main subject region having a low sum of map values and the main subject region having a small area, the possibility of deleting a portion corresponding to noise increases. Further, any one of a plurality of main subject areas may be selected based on a user operation.
 上述したように、複数の主要被写体領域の何れかを選択する場合には、第1実施形態の(a)に示した主要被写体領域への自動ズーム時に、選択された主要被写体領域へのズームが行われる。また、第1実施形態の(b)に示したAF,AE,AWBへの利用においては、選択された主要被写体領域に応じたAF,AE,AWB制御や、自動シャッタ制御が行われる。特に、自動シャッタ制御においては、複数の主要被写体領域の情報を総合して、全体を1つの主要被写体領域と見なしてしまうと、何れの主要被写体領域にも含まれない部分に対してAF制御を行ってしまうおそれがある。しかし、複数の主要被写体領域の何れかを選択することにより、複数の主要被写体領域の何れかに対して確実にAF制御を行うことができる。また、第1実施形態の(c)に示したスライドショーにおけるズーム中心の決定においては、選択された主要被写体領域の中心がズーム中心として決定される。また、第1実施形態の(d)に示した主要被写体領域の自動クロップにおいては、選択された主要被写体領域に対して自動クロップが行われる。 As described above, when any one of the plurality of main subject areas is selected, zooming to the selected main subject area is performed during the automatic zooming to the main subject area shown in (a) of the first embodiment. Done. Further, in the use for AF, AE, AWB shown in (b) of the first embodiment, AF, AE, AWB control and automatic shutter control corresponding to the selected main subject area are performed. In particular, in automatic shutter control, if information of a plurality of main subject areas is combined and the whole is regarded as one main subject area, AF control is performed on a portion not included in any main subject area. There is a risk of going. However, by selecting any of the plurality of main subject areas, it is possible to reliably perform AF control on any of the plurality of main subject areas. In the determination of the zoom center in the slide show shown in (c) of the first embodiment, the center of the selected main subject area is determined as the zoom center. In the automatic cropping of the main subject area shown in (d) of the first embodiment, automatic cropping is performed on the selected main subject area.
 (4)本発明の画像処理装置は、上記実施形態のパーソナルコンピュータの例に限定されない。本発明の画像処理装置は、デジタルの画像の再生表示機能やレタッチ機能を有する電子機器(例えば、フォトビューアー、デジタルフォトフレーム、写真の印刷装置など)であってもよい。また、本発明の撮像装置は、携帯電話端末のカメラモジュールとして実装されるものであってもよい。 (4) The image processing apparatus of the present invention is not limited to the example of the personal computer of the above embodiment. The image processing apparatus of the present invention may be an electronic device (for example, a photo viewer, a digital photo frame, a photo printing apparatus, etc.) having a digital image reproduction display function and a retouch function. The imaging device of the present invention may be mounted as a camera module of a mobile phone terminal.
 (5)上記実施形態のマッチング処理の方法は一例であり、本発明はこの例に限定されない。本発明では、基本的に差分絶対値総和を用いる例を説明したが、例えば照明変化にロバストにするために、正規化相関を用いてマッチング処理を行うようにしてもよい。また、例えば、Mpeg-7で定義される各種画像特徴量(Edge HistgramやScalable Color)などを用いてマッチング処理を行っても良い。また、マッチング処理においては、重みを考慮した代表色どうしの距離を計算するが、それぞれの代表色の数は異なっていても良い。この場合、例えば、EMD(Earth Mover Distance)などの手法を用いると良い。 (5) The matching processing method of the above embodiment is an example, and the present invention is not limited to this example. In the present invention, an example in which the sum of absolute differences is basically used has been described. However, for example, a matching process may be performed using normalized correlation in order to be robust against illumination changes. Further, for example, the matching process may be performed using various image feature amounts (Edge Histgram or Scalable Color) defined by Mpeg-7. In the matching process, the distance between representative colors in consideration of the weight is calculated, but the number of representative colors may be different. In this case, for example, a technique such as EMD (Earth Move Distance) may be used.
 (6)上記の各実施形態では、ローパス画像生成部23、領域分割部24、テンプレート設定部25、マッチング処理部26、マップ作成部27の各処理をソフトウエア的に実現する例を説明したが、ASICによってこれらの各処理をハードウエア的に実現しても勿論かまわない。 (6) In each of the above embodiments, an example has been described in which each process of the low-pass image generation unit 23, the region division unit 24, the template setting unit 25, the matching processing unit 26, and the map creation unit 27 is realized by software. Of course, each of these processes may be realized by hardware using an ASIC.
 以上の詳細な説明により、実施形態の特徴点および利点は明らかになるであろう。これは、特許請求の範囲が、その精神および権利範囲を逸脱しない範囲で前述のような実施形態の特徴点および利点にまで及ぶことを意図する。また、当該技術分野において通常の知識を有する者であれば、あらゆる改良および変更に容易に想到できるはずであり、発明性を有する実施形態の範囲を前述したものに限定する意図はなく、実施形態に開示された範囲に含まれる適当な改良物および均等物によることも可能である。 From the above detailed description, the features and advantages of the embodiment will become apparent. It is intended that the scope of the claims extend to the features and advantages of the embodiments as described above without departing from the spirit and scope of the right. Further, any person having ordinary knowledge in the technical field should be able to easily come up with any improvements and modifications, and there is no intention to limit the scope of the embodiments having the invention to those described above. It is also possible to use appropriate improvements and equivalents within the scope disclosed in.
 11…コンピュータ、14…CPU、23…ローパス画像生成部、24…領域分割部、25…テンプレート設定部、26…マッチング処理部、27…マップ作成部、31…電子カメラ、33…撮像素子、34…画像処理エンジン、35…ROM、37…記録I/F、39…表示部、40…記憶媒体 DESCRIPTION OF SYMBOLS 11 ... Computer, 14 ... CPU, 23 ... Low-pass image generation part, 24 ... Area division part, 25 ... Template setting part, 26 ... Matching processing part, 27 ... Map creation part, 31 ... Electronic camera, 33 ... Imaging element, 34 ... Image processing engine, 35 ... ROM, 37 ... Recording I / F, 39 ... Display unit, 40 ... Storage medium

Claims (26)

  1.  処理の対象となる対象画像の情報を取得する取得部と、
     前記対象画像を複数のブロックに分割する領域分割部と、
     前記複数のブロックのうち、前記対象画像の外周部に存在する1つ以上のブロックの画像に基づいて、1つ以上のテンプレートを設定する設定部と、
     前記対象画像を分割した前記複数のブロックの各々について代表値を算出する算出部と、
     マッチング対象のブロックの前記代表値と、前記1つ以上のテンプレートにおける前記代表値とをそれぞれ比較することによるマッチングを、前記複数のブロックごとに行うマッチング部と、
     前記マッチング部によるマッチングの結果に基づいて、前記対象画像における被写体の分布を示すマップを作成する作成部と
     を備えることを特徴とする画像処理装置。
    An acquisition unit for acquiring information of a target image to be processed;
    An area dividing unit for dividing the target image into a plurality of blocks;
    A setting unit configured to set one or more templates based on an image of one or more blocks present on an outer periphery of the target image among the plurality of blocks;
    A calculation unit that calculates a representative value for each of the plurality of blocks obtained by dividing the target image;
    A matching unit that performs matching for each of the plurality of blocks by comparing the representative value of the block to be matched with the representative value in the one or more templates,
    An image processing apparatus comprising: a creation unit that creates a map indicating a distribution of a subject in the target image based on a result of matching by the matching unit.
  2.  請求項1に記載の画像処理装置において、
     前記対象画像よりも低解像度の画像を少なくとも1つ生成する生成部をさらに備え、
     前記領域分割部は、前記対象画像および前記低解像度の画像を、それぞれ複数のブロックに分割し、
     前記設定部は、前記対象画像および前記低解像度の画像のそれぞれについて、前記1つ以上のテンプレートを設定し、
     前記マッチング部は、前記対象画像および前記低解像度の画像のそれぞれについて、前記マッチングを行い、
     前記作成部は、前記対象画像および前記低解像度の画像のそれぞれについて、被写体の分布を示すマップを作成し、作成した複数のマップに基づく演算を行うことにより、前記対象画像における被写体の分布を示す前記マップを作成する
     ことを特徴とする画像処理装置。
    The image processing apparatus according to claim 1.
    A generator that generates at least one image having a lower resolution than the target image;
    The region dividing unit divides the target image and the low-resolution image into a plurality of blocks,
    The setting unit sets the one or more templates for each of the target image and the low-resolution image,
    The matching unit performs the matching for each of the target image and the low-resolution image,
    The creation unit creates a map showing the distribution of the subject for each of the target image and the low-resolution image, and performs a calculation based on the plurality of created maps to show the distribution of the subject in the target image. An image processing apparatus that creates the map.
  3.  請求項2に記載の画像処理装置において、
     前記生成部は、前記対象画像に対して、特定の周波数帯域を抑制または透過する処理を施すことにより、前記低解像度の画像を少なくとも1つ生成する
     ことを特徴とする画像処理装置。
    The image processing apparatus according to claim 2,
    The generation unit generates at least one low-resolution image by performing a process of suppressing or transmitting a specific frequency band on the target image.
  4.  請求項3に記載の画像処理装置において、
     前記生成部は、前記対象画像に対して、ローパス処理とリサイズ処理との少なくとも一方を施すことにより、前記低解像度の画像を少なくとも1つ生成する
     ことを特徴とする画像処理装置。
    The image processing apparatus according to claim 3.
    The image processing apparatus generates the at least one low-resolution image by performing at least one of low-pass processing and resizing processing on the target image.
  5.  請求項3に記載の画像処理装置において、
     前記生成部は、前記対象画像に対して、バンドパスフィルタ処理を施すことにより、前記低解像度の画像を少なくとも1つ生成する
     ことを特徴とする画像処理装置。
    The image processing apparatus according to claim 3.
    The generation unit generates at least one low-resolution image by performing a band-pass filter process on the target image.
  6.  請求項1から請求項5のいずれか1項に記載の画像処理装置において、
     前記設定部は、前記対象画像の外周に存在するすべてのブロックの画像に基づいて、前記1つ以上のテンプレートを設定する
     ことを特徴とする画像処理装置。
    The image processing apparatus according to any one of claims 1 to 5,
    The image processing apparatus, wherein the setting unit sets the one or more templates based on images of all blocks existing on an outer periphery of the target image.
  7.  請求項1から請求項5のいずれか1項に記載の画像処理装置において、
     前記設定部は、前記対象画像のうち、下辺を除く3辺に存在するすべてのブロックの画像に基づいて、前記1つ以上のテンプレートを設定するか、または、前記3辺に存在するすべてのブロックの画像と、前記下辺に存在する予め定められた一部のブロックの画像とに基づいて、前記1つ以上のテンプレートを設定するか、または、左辺および右辺に存在するすべてのブロックの画像に基づいて、前記1つ以上のテンプレートを設定する
     ことを特徴とする画像処理装置。
    The image processing apparatus according to any one of claims 1 to 5,
    The setting unit sets the one or more templates based on images of all blocks existing on three sides except the lower side of the target image, or all blocks existing on the three sides. And the one or more templates are set based on the image of a predetermined block existing on the lower side and the images of all the blocks existing on the left side and the right side And setting the one or more templates.
  8.  請求項7に記載の画像処理装置において、
     前記取得部は、前記対象画像の撮像時における撮像装置の姿勢情報をさらに取得し、
     前記設定部は、前記姿勢情報に基づいて、前記複数のブロックから1つ以上のブロックを選択し、選択したブロックの画像に基づいて、前記1つ以上のテンプレートを設定する
     ことを特徴とする画像処理装置。
    The image processing apparatus according to claim 7.
    The acquisition unit further acquires posture information of the imaging device at the time of imaging the target image,
    The setting unit selects one or more blocks from the plurality of blocks based on the posture information, and sets the one or more templates based on an image of the selected block. Processing equipment.
  9.  請求項1から請求項5のいずれか1項に記載の画像処理装置において、
     前記設定部は、前記マッチング対象のブロックの、前記対象画像内における位置に基づいて、前記対象画像の外周に存在するすべてのブロックから、一部のブロックを選択し、選択した複数のブロックの画像に基づいて前記1つ以上のテンプレートを設定する
     ことを特徴とする画像処理装置。
    The image processing apparatus according to any one of claims 1 to 5,
    The setting unit selects some blocks from all the blocks present on the outer periphery of the target image based on positions of the matching target blocks in the target image, and images of the selected plurality of blocks The one or more templates are set based on the image processing apparatus.
  10.  請求項1から請求項9のいずれか1項に記載の画像処理装置において、
     前記算出部は、前記代表値として、ブロック内に含まれる画素ごとの画素値を算出し、
     前記マッチング部は、マッチング対象のブロック内の任意の画素の画素値間の差分に基づいて、前記マッチング対象のブロックに関する評価値とする
     ことを特徴とする画像処理装置。
    The image processing apparatus according to any one of claims 1 to 9,
    The calculation unit calculates a pixel value for each pixel included in the block as the representative value,
    The image processing apparatus, wherein the matching unit sets an evaluation value related to the matching target block based on a difference between pixel values of arbitrary pixels in the matching target block.
  11.  請求項10に記載の画像処理装置において、
     前記算出部は、前記代表値として、ブロック内に含まれる画素ごとの画素値を算出し、
     前記マッチング部は、マッチング対象のブロック内の任意の画素の画素値と、任意のテンプレートのブロック内において、前記任意の画素に対応する位置の画素の画素値との差分の絶対値を、前記マッチング対象のブロック内のすべての画素について求めて加算した値である差分絶対値総和を、前記1つ以上のテンプレートのそれぞれについて求め、求めた複数の前記差分絶対値総和のうち、最小の前記差分絶対値総和の値を、前記マッチング対象のブロックに関する前記評価値とする
     ことを特徴とする画像処理装置。
    The image processing apparatus according to claim 10.
    The calculation unit calculates a pixel value for each pixel included in the block as the representative value,
    The matching unit calculates an absolute value of a difference between a pixel value of an arbitrary pixel in a matching target block and a pixel value of a pixel at a position corresponding to the arbitrary pixel in an arbitrary template block. The difference absolute value sum, which is a value obtained by obtaining and adding all the pixels in the target block, is obtained for each of the one or more templates, and the smallest difference absolute value among the plurality of obtained difference absolute value sums An image processing apparatus characterized in that a value sum of values is used as the evaluation value for the matching target block.
  12.  請求項10に記載の画像処理装置において、
     前記算出部は、ブロック内に含まれる画素ごとの画素値を算出した後に、ブロック内に含まれる前記画素値に対して周波数領域への画像変換を行うことにより前記代表値を算出し、
     前記マッチング部は、マッチング対象のブロック内の任意の代表値と、任意のテンプレートのブロック内において、前記任意の代表値に対応する代表値との差分の絶対値を、前記マッチング対象のブロック内のすべての画素に対応する代表値について求めて加算した値である差分絶対値総和を、前記1つ以上のテンプレートのそれぞれについて求め、求めた複数の前記差分絶対値総和のうち、最小の前記差分絶対値総和の値を、前記マッチング対象のブロックに関する前記評価値とする
     ことを特徴とする画像処理装置。
    The image processing apparatus according to claim 10.
    The calculation unit calculates the representative value by calculating a pixel value for each pixel included in the block and then performing image conversion to a frequency domain on the pixel value included in the block,
    The matching unit calculates an absolute value of a difference between an arbitrary representative value in a matching target block and a representative value corresponding to the arbitrary representative value in an arbitrary template block in the matching target block. A sum of absolute differences, which is a value obtained by obtaining and adding representative values corresponding to all pixels, is obtained for each of the one or more templates, and the smallest absolute difference among the plurality of obtained sums of absolute differences. An image processing apparatus characterized in that a value sum of values is used as the evaluation value for the matching target block.
  13.  請求項12に記載の画像処理装置において、
     前記算出部は、ブロック内に含まれる前記画素値に対して、フーリエ変換と、離散コサイン変換と、ウェーブレット変換との少なくとも1つを行うことにより前記代表値を算出する
     ことを特徴とする画像処理装置。
    The image processing apparatus according to claim 12.
    The calculation unit calculates the representative value by performing at least one of Fourier transform, discrete cosine transform, and wavelet transform on the pixel value included in the block. apparatus.
  14.  請求項10に記載の画像処理装置において、
     前記算出部は、前記代表値として、前記対象画像を構成する複数の色成分の分布に基づいて、色に関する特徴を示す値を、前記複数のブロックごとに算出し、
     前記マッチング部は、マッチング対象のブロックの代表値と、任意のテンプレートのブロックの代表値との差分を加算した値である差分絶対値総和を、前記1つ以上のテンプレートのそれぞれについて求め、求めた複数の前記差分絶対値総和のうち、最小の前記差分絶対値総和の値と、最大の前記差分絶対値総和の値と、前記差分絶対値総和の平均値との少なくとも1つを、前記マッチング対象のブロックに関する前記評価値とする
     ことを特徴とする画像処理装置。
    The image processing apparatus according to claim 10.
    The calculation unit calculates, as the representative value, a value indicating a color feature for each of the plurality of blocks based on a distribution of a plurality of color components constituting the target image.
    The matching unit obtains a difference absolute value sum, which is a value obtained by adding a difference between a representative value of a matching target block and a representative value of a block of an arbitrary template, for each of the one or more templates. At least one of the minimum difference absolute value total value, the maximum difference absolute value total value, and the average difference absolute value total value among the plurality of absolute difference total values is a matching target. An image processing apparatus characterized in that the evaluation value relating to a block of the image is the evaluation value.
  15.  請求項14に記載の画像処理装置において、
     前記算出部は、前記代表値として、ヒストグラムに基づく代表色を示す値と、相対ヒストグラムに基づく特徴量を示す値との少なくとも一方を算出する
     ことを特徴とする画像処理装置。
    The image processing apparatus according to claim 14.
    The image processing apparatus, wherein the calculation unit calculates, as the representative value, at least one of a value indicating a representative color based on a histogram and a value indicating a feature amount based on a relative histogram.
  16.  請求項10から請求項15のいずれか1項に記載の画像処理装置において、
     前記作成部は、前記評価値と、前記評価値の取り得る値の範囲に応じて定められた閾値とを比較し、比較結果に基づいて前記マップを作成する
     ことを特徴とする画像処理装置。
    The image processing apparatus according to any one of claims 10 to 15,
    The creation unit compares the evaluation value with a threshold value determined according to a range of values that can be taken by the evaluation value, and creates the map based on a comparison result.
  17.  請求項1から請求項16のいずれか1項に記載の画像処理装置において、
     前記領域分割部により分割された前記複数のブロックのうち、前記設定部により前記テンプレートに設定されていないブロックについて、前記作成部により作成した前記マップにおける値と所定の閾値とを比較し、比較結果に基づいて、1つ以上のテンプレートを新たに追加する追加設定部をさらに備え、
     前記マッチング部は、マッチング対象のブロックの前記代表値と、前記追加設定部により追加された前記1つ以上のテンプレートにおける前記代表値とをそれぞれ比較することによるマッチングを、前記複数のブロックごとに行い、
     前記作成部は、前記マッチング部によるマッチングの結果に基づいて、前記対象画像における被写体の分布を示すマップを作成する
     ことを特徴とする画像処理装置。
    The image processing apparatus according to any one of claims 1 to 16,
    Of the plurality of blocks divided by the region dividing unit, for the blocks not set in the template by the setting unit, the value in the map created by the creating unit is compared with a predetermined threshold value, and the comparison result And an additional setting unit for newly adding one or more templates,
    The matching unit performs matching for each of the plurality of blocks by comparing the representative value of the block to be matched with the representative value in the one or more templates added by the additional setting unit. ,
    The creation unit creates a map indicating a distribution of subjects in the target image based on a result of matching by the matching unit.
  18.  請求項1から請求項17のいずれか1項に記載の画像処理装置において、
     前記対象画像に複数の被写体画像が含まれる場合に、前記作成部により作成した前記マップに対して、ラベリング処理と、クラスタリングによるグループ化処理との少なくとも一方を行うことにより前記複数の被写体を識別可能にする処理を行う処理部をさらに備える
     ことを特徴とする画像処理装置。
    The image processing apparatus according to any one of claims 1 to 17,
    When the target image includes a plurality of subject images, the plurality of subjects can be identified by performing at least one of a labeling process and a clustering grouping process on the map created by the creating unit. An image processing apparatus, further comprising: a processing unit that performs the processing described above.
  19.  請求項1から請求項18のいずれか1項に記載の画像処理装置において、
     画像を表示する表示部を備え、
     前記表示部は、前記対象画像を表示する際に、前記マップにおける値が所定の閾値を超える領域に対応する前記対象画像上の領域を、視認可能に表示する
     ことを特徴とする画像処理装置。
    The image processing apparatus according to any one of claims 1 to 18,
    A display unit for displaying images;
    The display unit displays an area on the target image corresponding to an area where a value in the map exceeds a predetermined threshold when the target image is displayed.
  20.  請求項1から請求項19のいずれか1項に記載の画像処理装置において、
     前記対象画像に対して、前記マップにおける値が所定の閾値を超える領域に対応する前記対象画像上の領域をトリミング処理する画像処理部をさらに備える
     ことを特徴とする画像処理装置。
    The image processing apparatus according to any one of claims 1 to 19,
    An image processing apparatus, further comprising: an image processing unit that performs a trimming process on an area on the target image corresponding to an area where a value in the map exceeds a predetermined threshold with respect to the target image.
  21.  被写体の像を撮像する撮像部と、
     請求項1から請求項20のいずれか1項に記載の画像処理装置とを備え、
     前記取得部は、前記撮像部から前記対象画像の情報を取得する
     ことを特徴とする撮像装置。
    An imaging unit that captures an image of a subject;
    An image processing apparatus according to any one of claims 1 to 20,
    The said acquisition part acquires the information of the said target image from the said imaging part. The imaging device characterized by the above-mentioned.
  22.  請求項21に記載の撮像装置において、
     前記対象画像に対して、前記マップにおける値が所定の閾値を超える領域に対応する前記対象画像上の領域をトリミング処理する画像処理部をさらに備える
     ことを特徴とする撮像装置。
    The imaging device according to claim 21, wherein
    An image processing apparatus, further comprising: an image processing unit that performs a trimming process on a region on the target image corresponding to a region where a value in the map exceeds a predetermined threshold with respect to the target image.
  23.  請求項21に記載の撮像装置において、
     前記マップに基づいて、前記撮像部による撮像時における焦点調節制御と露出制御との少なくとも一方を行う制御部をさらに備える
     ことを特徴とする撮像装置。
    The imaging device according to claim 21, wherein
    An imaging apparatus, further comprising: a control unit that performs at least one of focus adjustment control and exposure control during imaging by the imaging unit based on the map.
  24.  請求項21に記載の撮像装置において、
     前記マップに基づいて、主要被写体の大きさと位置との少なくとも一方を監視し、監視結果に応じて、前記撮像部による撮像を開始する制御部をさらに備える
     ことを特徴とする撮像装置。
    The imaging device according to claim 21, wherein
    An imaging apparatus, further comprising: a control unit that monitors at least one of a size and a position of a main subject based on the map and starts imaging by the imaging unit according to a monitoring result.
  25.  請求項21に記載の撮像装置において、
     前記撮像部は、光学ズーム機能と電子ズーム機能との少なくとも一方を有し、
     前記マップに基づいて、前記撮像部による前記光学ズーム機能と前記電子ズーム機能との少なくとも一方を実行する
     ことを特徴とする撮像装置。
    The imaging device according to claim 21, wherein
    The imaging unit has at least one of an optical zoom function and an electronic zoom function,
    An image pickup apparatus that executes at least one of the optical zoom function and the electronic zoom function by the image pickup unit based on the map.
  26.  処理の対象となる対象画像の情報を取得する取得処理と、
     前記対象画像を複数のブロックに分割する領域分割処理と、
     前記複数のブロックのうち、前記対象画像の外周部に存在する1つ以上のブロックの画像に基づいて、1つ以上のテンプレートを設定する設定処理と、
     前記対象画像を分割した前記複数のブロックの各々について代表値を算出する算出処理と、
     マッチング対象のブロックの前記代表値と、前記1つ以上のテンプレートにおける前記代表値とをそれぞれ比較することによるマッチングを、前記複数のブロックごとに行うマッチング処理と、
     前記マッチング処理の結果に基づいて、前記対象画像における被写体の分布を示すマップを作成する作成処理と
     をコンピュータに実行させる画像処理プログラム。
    An acquisition process for acquiring information of a target image to be processed;
    A region dividing process for dividing the target image into a plurality of blocks;
    A setting process for setting one or more templates based on an image of one or more blocks present on the outer periphery of the target image among the plurality of blocks;
    A calculation process for calculating a representative value for each of the plurality of blocks obtained by dividing the target image;
    A matching process in which matching is performed for each of the plurality of blocks by comparing the representative value of the block to be matched with the representative value in the one or more templates,
    An image processing program for causing a computer to execute a creation process for creating a map indicating a distribution of a subject in the target image based on a result of the matching process.
PCT/JP2011/000098 2010-01-13 2011-01-12 Image processing device, image capture device, and image processing program WO2011086901A1 (en)

Applications Claiming Priority (6)

Application Number Priority Date Filing Date Title
JP2010005072 2010-01-13
JP2010-005072 2010-01-13
JP2010-199718 2010-09-07
JP2010199718 2010-09-07
JP2010-285095 2010-12-21
JP2010285095 2010-12-21

Publications (1)

Publication Number Publication Date
WO2011086901A1 true WO2011086901A1 (en) 2011-07-21

Family

ID=44304179

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2011/000098 WO2011086901A1 (en) 2010-01-13 2011-01-12 Image processing device, image capture device, and image processing program

Country Status (2)

Country Link
JP (1) JP5487126B2 (en)
WO (1) WO2011086901A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014044580A (en) * 2012-08-27 2014-03-13 Casio Comput Co Ltd Pattern generating device, pattern generation method, program, pattern generating system, and server

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11102437A (en) * 1997-09-25 1999-04-13 Canon Inc Image-pickup device and its method
JP2000172849A (en) * 1998-12-09 2000-06-23 Fujitsu Ltd Picture processor and pattern extracting device
JP2005267480A (en) * 2004-03-22 2005-09-29 Canon Inc Recognition object segmentation device and method
JP2007158941A (en) * 2005-12-07 2007-06-21 Sony Corp Object area detection apparatus and method, imaging device and program
JP2008131580A (en) * 2006-11-24 2008-06-05 Olympus Imaging Corp Imaging apparatus, and image processing method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2642001B2 (en) * 1991-05-17 1997-08-20 大日本スクリーン製造株式会社 Image processing method
JPH09197575A (en) * 1996-01-19 1997-07-31 Fuji Photo Film Co Ltd Exposure deciding method and exposure controller
JP2007122101A (en) * 2005-10-24 2007-05-17 Matsushita Electric Ind Co Ltd Image processor and image processing method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11102437A (en) * 1997-09-25 1999-04-13 Canon Inc Image-pickup device and its method
JP2000172849A (en) * 1998-12-09 2000-06-23 Fujitsu Ltd Picture processor and pattern extracting device
JP2005267480A (en) * 2004-03-22 2005-09-29 Canon Inc Recognition object segmentation device and method
JP2007158941A (en) * 2005-12-07 2007-06-21 Sony Corp Object area detection apparatus and method, imaging device and program
JP2008131580A (en) * 2006-11-24 2008-06-05 Olympus Imaging Corp Imaging apparatus, and image processing method

Also Published As

Publication number Publication date
JP2012146179A (en) 2012-08-02
JP5487126B2 (en) 2014-05-07

Similar Documents

Publication Publication Date Title
US8928772B2 (en) Controlling the sharpness of a digital image
US8724919B2 (en) Adjusting the sharpness of a digital image
JP4840426B2 (en) Electronic device, blurred image selection method and program
JP5825172B2 (en) Image determination apparatus, image determination method, and computer program for image determination
EP1954031A1 (en) Imaging device, image processing device, and program
US8472747B2 (en) Image composition device, image composition method, and storage medium storing program
JP5525757B2 (en) Image processing apparatus, electronic device, and program
JP4868046B2 (en) Image processing apparatus, image processing method, and program
JP5509621B2 (en) Image processing apparatus, camera, and program
JP5487126B2 (en) Image processing apparatus, imaging apparatus, and image processing program
JP6938282B2 (en) Image processing equipment, image processing methods and programs
JP6068895B2 (en) Image processing apparatus and program
JP5713256B2 (en) Image processing apparatus, imaging apparatus, and image processing program
JP5146223B2 (en) Program, camera, image processing apparatus, and image contour extraction method
JP6776532B2 (en) Image processing equipment, imaging equipment, electronic devices and image processing programs
JP5463688B2 (en) Focus evaluation device, camera and program
JP2020009099A (en) Image processing device, image processing method, and program
JP6326841B2 (en) Image processing apparatus, imaging apparatus, and image processing program
JP6248662B2 (en) Image processing apparatus, imaging apparatus, and image processing program
JP2018152095A (en) Image processing apparatus, imaging apparatus, and image processing program
JP5631181B2 (en) Image processing apparatus, control method therefor, and program
JP7059239B2 (en) Image processing equipment, imaging equipment, image processing methods, programs and recording media
JP6314281B1 (en) Image processing method and foreground region acquisition method
JP2009130840A (en) Imaging apparatus, control method thereof ,and program
JP6405638B2 (en) Subject detection device, imaging device, and program

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11732776

Country of ref document: EP

Kind code of ref document: A1