IMAGE PROCESSING APPARATUS, IMAGING APPARATUS, IMAGE PROCESSING METHOD, AND PROGRAM
The image processing device uses multiple subject maps to accurately specify and enhance subject areas in low contrast or high ISO conditions, addressing noise and contrast issues for effective image processing.
Patent Information
- Application Number
- JP2020064201
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-03-31
- Publication Date
- 2024-10-09
- Estimated Expiration
- 2040-03-31
Smart Images

Figure 0007564635000001 
Figure 0007564635000002 
Figure 0007564635000003
Abstract
Description
[Technical field]
[0001] The present invention relates to an image processing device, an imaging device, an image processing method and a program, and in particular to a technique for applying image processing to an image obtained by imaging, for adding a predetermined effect after imaging. [Background technology]
[0002] In some cases, image processing is applied to a captured image by classifying the areas of the subject image appearing in the image and adding a predetermined effect to a specific area or to each area. For example, Patent Document 1 discloses a technology for classifying pixel groups included in a captured image by the defocus amount of the pixel image and applying image processing to pixels belonging to a specific defocus range, thereby generating images that show different expressions of depth of field. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2008-015754 A Summary of the Invention [Problem to be solved by the invention]
[0004] However, in the description of Patent Document 1, the defocus amount is derived based on an image, so when an image is captured in a low-contrast environment or with a high ISO sensitivity setting, the defocus amount derivation accuracy decreases due to noise generated in the captured image. As a result, it is not possible to appropriately specify a defocus range that includes a desired subject, and when image processing is applied, it is possible that an image with a desirable effect cannot be output.
[0005] The present invention has been made in consideration of the above-mentioned problems, and aims to provide an image processing device, an imaging device, an image processing method, and a program that can suitably identify a subject area and, for example, add a desired effect to the subject area. [Means for solving the problem]
[0006] In order to achieve the above-mentioned object, an image processing device of the present invention comprises an acquisition means for acquiring classification information for classifying objects related to each pixel of a captured image, a setting means for setting a reference area in the captured image, a first configuration means for configuring a first object map indicating an area in the captured image where an image of the object related to the reference area appears based on the classification information, a second configuration means for configuring a second object map indicating an area in the captured image where an image of the object related to the reference area appears not based on the classification information, an evaluation means for evaluating effectiveness based on information indicated by the first object map, a determination means for determining the object area based on at least one of the first object map and the second object map based on the evaluation by the evaluation means, and an execution means for executing different image processing on the object area of the captured image and an area other than the object area. The determining means changes the contribution rate of the first object map in relation to the determination of the object region based on the evaluation by the evaluating means. The present invention is characterized by the above. Effect of the Invention
[0007] With this configuration, the present invention makes it possible to suitably identify a subject region and, for example, to add a desired effect to the subject region. [Brief description of the drawings]
[0008] [Figure 1] FIG. 1 is a block diagram illustrating a functional configuration of a digital camera 100 according to an embodiment of the present invention. [Diagram 2] FIG. 1 is a diagram for explaining a detailed configuration of an image capturing unit 105 according to an embodiment of the present invention. [Diagram 3] FIG. 1 is a block diagram illustrating a functional configuration of an image processing unit 107 according to an embodiment of the present invention. [Figure 4] FIG. 2 is a diagram for explaining a method for deriving a defocus amount according to an embodiment of the present invention; [Diagram 5] FIG. 2 is another diagram for explaining the method for deriving the defocus amount according to the embodiment of the present invention. [Figure 6] FIG. 1 is a diagram for explaining image effect processing executed by an image processing unit 107 according to an embodiment of the present invention; [Figure 7] FIG. 13 is a diagram illustrating a defocus map generated by the image effect processing according to the embodiment of the present invention; [Figure 8] FIG. 13 is a diagram illustrating a histogram of the defocus amount configured in the image effect processing according to the embodiment of the present invention; [Figure 9] FIG. 13 is a diagram illustrating a first subject map configured by the image effect processing according to the embodiment of the present invention; [Figure 10] FIG. 1 is a diagram for explaining the effectiveness of a first object map and the contribution rate of a second object map in the image effect processing according to an embodiment of the present invention; [Figure 11] FIG. 1 is a diagram for explaining a flow of determining a subject area in image effect processing according to an embodiment of the present invention; [Figure 12] 1 is a flowchart illustrating an image effect process executed by the image processing unit 107 according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0009] [Embodiment] Hereinafter, the embodiments will be described in detail with reference to the attached drawings. Note that the following embodiments do not limit the invention according to the claims. Although the embodiments describe a number of features, not all of these features are essential to the invention, and the features may be combined in any manner. Furthermore, in the attached drawings, the same reference numbers are used for the same or similar configurations, and duplicated descriptions are omitted.
[0010] In the embodiment described below, an example of the present invention is applied to a digital camera that can acquire information (defocus map) corresponding to the distance distribution in the depth direction (depth direction) of a subject in an imaging range, as an example of an image processing device. However, the present invention can be applied to any device that can acquire a captured image and classification information that classifies the image of a subject related to each pixel of the captured image.
[0011] <Digital camera configuration> FIG. 1 is a block diagram showing the functional configuration of a digital camera 100 according to an embodiment of the present invention.
[0012] The system control unit 101 is a control device, such as a CPU, that controls each block of the digital camera 100. The system control unit 101 reads out an operation program for each block of the digital camera 100 from a ROM 102, expands it into a RAM 103, and executes it to control the operation of each block of the digital camera 100.
[0013] The ROM 102 is a rewritable non-volatile memory such as a flash ROM. The ROM 102 stores the operation programs of each block of the digital camera 100 as well as parameters required for the operation of each block. On the other hand, the RAM 103 is a rewritable volatile memory. The RAM 103 is used not only as an area for loading the operation programs of each block of the digital camera 100 but also as a temporary storage area for intermediate data output by the operation of each block. In this embodiment, the system control unit 101 and an image processing unit 107 described below use the RAM 103 as a work memory.
[0014] The optical system 104 forms a subject image on the imaging unit 105. The optical system 104 includes, for example, a fixed lens, a variable magnification lens that changes the focal length, a focus lens that adjusts the focus, etc. The optical system 104 also includes an aperture, and the aperture adjusts the aperture diameter of the optical system to adjust the amount of light during shooting.
[0015] The imaging unit 105 is an imaging element such as a CCD image sensor or a CMOS image sensor. The imaging unit 105 obtains an analog image signal by photoelectrically converting an optical image formed on the imaging surface of the imaging element by the optical system 104. The imaging unit 105 outputs the obtained analog image signal to the A / D conversion unit 106.
[0016] The A / D conversion unit 106 obtains digital image data (hereinafter simply referred to as image data) by applying A / D conversion processing to the input analog image signal. The A / D conversion unit 106 outputs the obtained image data to the RAM 103 for storage.
[0017] The image processing unit 107 performs various types of image processing on the image data stored in the RAM 103, and records the image data after the image processing on the recording medium 108. The image processing performed by the image processing unit 107 may include, for example, white balance adjustment, color interpolation, reduction / enlargement processing, etc. The image processing unit 107 also applies image processing (image effect processing) that adds a predetermined effect to the subject image appearing in the image data.
[0018] The recording medium 108 is, for example, a recording device such as a memory card that may be configured to be detachable from the digital camera 100. The recording medium 108 records image data (captured image) to which image processing is applied by the image processing unit 107, an image signal (RAW image) A / D converted by the A / D conversion unit 106, and the like as recorded images.
[0019] The display unit 109 is a display device such as an LCD, and presents various types of information in the digital camera 100. When the imaging unit 105 is capturing an image, the display unit 109 displays (through display) A / D converted image data, thereby functioning as a digital viewfinder.
[0020] The operation input unit 110 includes a user input interface such as a release switch, a setting button, a mode setting dial, etc., and when it detects an operation input made by a user, it outputs a control signal corresponding to the operation input to the system control unit 101. In addition, in an aspect in which the display unit 109 is equipped with a touch panel sensor, the operation input unit 110 also functions as an interface that detects a touch operation made to the display unit 109.
[0021] These functional blocks included in the digital camera 100 are basically connected by a bus 111, and are configured so that signals can be exchanged between the blocks via the bus 111.
[0022] In this embodiment, the processing is described as being realized by circuits and processors corresponding to each block of the hardware provided in the digital camera 100. However, the embodiment of the present invention is not limited to this, and the processing of each block may be realized by a program that performs the same processing as that of each block.
[0023] Configuration of the imaging unit Next, a detailed configuration of the image sensor included in the image capturing unit 105 of this embodiment will be described with reference to FIG.
[0024] As shown in Fig. 2(a), the imaging element has a plurality of pixels 200 regularly arranged two-dimensionally. Specifically, the plurality of pixels 200 are arranged, for example, in a two-dimensional lattice pattern. Note that the arrangement of the pixels 200 is not limited to a lattice arrangement, and other arrangements may be adopted.
[0025] In order to realize a ranging function of the imaging surface phase difference ranging method, each pixel 200 has a microlens 201 and a pair of photoelectric conversion units 202a and b (hereinafter referred to as pupil division pixels 202a and b, respectively) as shown in FIG. 2(b). The pupil division pixels 202a and b are photoelectric conversion units configured to have the same shape and size, with the imaging surface having a rectangular shape with the y-axis direction as the longitudinal direction. In each pixel 200, the pupil division pixels 202a and b are arranged line-symmetrically with respect to the perpendicular bisector of the microlens 201 along the y-axis direction as the axis of symmetry. Note that the imaging surface shape of the pupil division pixels 202a and b is not limited to this, and may be any shape. Furthermore, the arrangement of the pupil division pixels 202a and b is not limited to being arranged in parallel in the x direction, and other arrangements may be adopted.
[0026] With this configuration, the image capturing section 105 of this embodiment outputs image A related to the image signal output from the pupil division pixel 202a that all pixels of the image sensor have, and image B related to the image signal output from the pupil division pixel 202b in the same manner. The images A and B are in a relationship having a parallax according to the distance from the focused position.
[0027] More specifically, in each pixel 200, pupil-divided pixels 202a and 202b are configured to receive different light beams among the light beams that enter through the microlens 201, and therefore photoelectrically convert optical images related to the light beams that have passed through different regions of the exit pupil of the optical system 104. That is, images A and B are generated for light beams that have passed through different regions (pupil-divided regions) of the exit pupil, and therefore the subject is imaged at shooting positions shifted by the difference in the center of gravity of the pupil-divided regions, resulting in parallax. In other words, images A and B correspond to a group of images obtained by imaging an imaging range from different viewpoints.
[0028] 2, the image capturing unit 105 is configured to capture images A and B used to derive the distance distribution of a subject in the imaging range, but the method of capturing images A and B is not limited to this. For example, images A and B may be a group of images captured by a plurality of imaging devices installed at a base line length apart, or images A and B may be a group of images captured by a single imaging device (such as a so-called binocular camera) having a plurality of optical systems and imaging units.
[0029] <Functional configuration of the image processing unit> Next, the functional configuration of the image processing unit 107 that realizes the above-mentioned image effect processing will be described with reference to FIG. 3. The image effect processing performed by the image processing unit 107 of this embodiment will be described as processing that specifies the area of the image of a person included in a captured image (captured image) as a subject area and applies an effect of changing the brightness of the subject area to a brightness different from that at the time of capture. However, the implementation of the present invention is not limited to such image effect processing. The present invention only needs to detect a predetermined type of subject and specify the subject area based on the detection result, and any effect may be applied to at least one of the subject area and other areas. Here, the captured image is an image (an image corresponding to a state without pupil division) configured by adding together the image A captured by the pupil division pixel 202a and the image B captured by the pupil division pixel 202b.
[0030] The generating unit 300 generates information indicating the distance distribution of the subject in the depth direction of the imaging range based on the images A and B obtained by imaging. In this embodiment, the generating unit 300 generates, as the information indicating the distance distribution of the subject, a defocus map having a pixel structure corresponding to the captured image and storing, for each pixel, information on the defocus amount of the image of the subject appearing at the same position in the captured image.
[0031] <Derivation of defocus amount> Here, derivation of the defocus amount related to the defocus map generated by the generation unit 300 will be described with reference to the drawings. In this embodiment, the defocus amount will be described as being derived based on a group of images (images A and B) having parallax obtained by imaging.
[0032] The derivation of the defocus amount includes, for example, a process of dividing an image (images A and B) 400 into minute blocks 401 indicated by dashed lines as shown in FIG. 4. For example, when each pixel of the target image A is set as a pixel of interest, the minute block 401 may be set in an area of a predetermined size centered on the pixel. In the following description, the minute block 401 is set as a square area of m×m pixels centered on the pixel of interest, but the shape and size of the minute block 401 may be any. The minute block 401 is set for each pixel of interest, and the minute blocks 401 may overlap between different pixels of interest. The generation unit 300 may derive the defocus amount after previously applying a process of applying a band pass filter to the images A and B for detecting the phase difference.
[0033] For example, when a minute block 401 is set for each pixel in images A and B, correlation calculation processing is performed for each pixel (pixel of interest) between the two images to derive the amount of shift (image shift amount) of the image contained in the minute block 401 corresponding to that pixel. When the number of data (number of pixels) of a (pair of) minute blocks 401 defined for a pixel of interest at the same position in images A and B is m, the pixel data of the pair of minute blocks 401 are expressed as E(1) to E(m) and F(1) to F(m), respectively. In this case, in the correlation calculation, if the amount of shift (of data) is k (an integer) [pixels], then the correlation amount C(k) is C(k)=Σ|E(n)-F(n+k)| Here, the Σ calculation is performed for n, and n and n+k are limited to the range of 1 to m. The shift amount k is the relative shift amount in units of the detection pitch of a pair of image data.
[0034] In this way, when the correlation amount is derived for a pair of pupil divided images (a pair of minute blocks 401) related to one pixel of interest, the shift amount k and the correlation amount C(k) have a relationship as shown discretely in the graph of Fig. 5. In this case, since the correlation amount C(k) is minimum at the image shift amount with the highest correlation, the following three-point interpolation method is used to derive the shift amount x that gives the minimum value C(x) for continuous correlation amounts. x=kj+D / SLOP C(x)=C(kj)-|D| D={C(kj-1)-C(kj+1)} / 2 SLOP=MAX{C(kj+1)-C(kj),C(kj-1)-C(kj)}
[0035] Here, kj is the shift amount k at which the discrete correlation amount C(k) is minimized. The shift amount x calculated in this way is included in the distance information as the image shift amount at one pixel of interest. Note that the unit of the image shift amount x is also [pixel].
[0036] Therefore, the defocus amount DEF at each pixel of interest is calculated using the image shift amount x as follows: DEF = KX PY x Here, PY is the pixel pitch of the image sensor (the distance between the pixels that make up the image sensor, in mm / pixel units), and KX is a conversion coefficient determined by the magnitude of the opening angle of the center of gravity of the light beams that pass through a pair of ranging pupils. Note that the magnitude of the opening angle of the center of gravity of the light beams that pass through a pair of ranging pupils changes depending on the size of the lens aperture (F-number), and therefore is determined according to the information on the settings at the time of imaging.
[0037] In this way, the generating unit 300 can derive the defocus amount of the subject at each pixel of the captured image by repeatedly calculating while shifting the pixel position of interest by one pixel at a time. When the generating unit 300 derives the defocus amount of each pixel, the generating unit 300 generates a defocus map, which is two-dimensional information having the same structure as the captured image and which uses the defocus amount as a pixel value, as distance information. That is, since the defocus amount is a value that changes according to the amount of deviation of the position in the depth direction from the subject distance in focus in the captured image, the defocus map is information equivalent to the distance distribution in the depth direction of the subject at the time of image capture.
[0038] The detection unit 301 detects a predetermined type of subject included in the captured image. In this embodiment, the detection unit 301 detects a face area of a person included in the captured image in order to extract the area of the person in the captured image as a subject area. The detection of the face area may be performed by a conventional method such as pattern matching, and the detection unit 301 outputs information on the position and size of the detected face area in the captured image as a detection result. In the image effect processing performed by the image processing unit 107 in this embodiment, the face area detected in this way is set as a reference area for setting the subject area.
[0039] The construction unit 302 constructs a histogram (frequency distribution) indicating the distribution of the defocus amount for the defocus map generated by the generation unit 300. As described above, the defocus amount corresponds to the distance of the subject included in the imaging range, and the histogram constructed by the construction unit 302 indicates the frequency of each distance when the subject of each pixel in the captured image is classified by its subject distance.
[0040] The extraction unit 303 extracts a region that is a candidate for the subject region based on the histogram configured by the configuration unit 302. In this embodiment, as one approach to extracting a candidate for the subject region, a predetermined distance range to which the subject (face of a person) included in the reference region belongs is specified based on the histogram, and a region in which the subject in the distance range appears is extracted as a candidate for the subject region. Although details will be described later, the extraction unit 303 derives an average value dr of the defocus amount of the reference region based on the defocus map. Then, the extraction unit 303 specifies a range of defocus amounts (minimum (lower limit) defocus amount d1 and maximum (upper limit) defocus amount d2) that includes the average value dr from the histogram and shows a frequency exceeding a predetermined threshold. Furthermore, the extraction unit 303 specifies a subject region (candidate) in which the image of a person is assumed to appear in the captured image by extracting pixels that indicate a defocus amount that belongs to the range of the defocus amount from the defocus map.
[0041] The subject region candidates may have a pixel structure corresponding to the captured image, similar to a defocus map, and may be configured by storing logical information about whether each pixel belongs to the range of the defocus amount. Hereinafter, the information about the subject region candidates extracted by the extraction unit 303 will be referred to as a first subject map.
[0042] The estimation unit 304 estimates a region that is a candidate for the subject region based on the face detection result by the detection unit 301. In this embodiment, the detection target by the detection unit 301 is a person's face region, and by considering the size of the face region, it is possible to estimate how other parts of the human body are distributed in the captured image. That is, since there is a certain degree of constraint on the arrangement relationship of the other parts of the person's head and torso with respect to the face region of the person, once the face region is specified, it is possible to estimate how the image of the person is distributed in the captured image. Therefore, in this embodiment, as another approach to extracting a candidate for the subject region, a region of a predetermined shape (outline of a person) whose position and size are determined relative to the detected face region is extracted as a candidate for the subject region. In other words, the candidate for the subject region estimated and extracted by the estimation unit 304 is extracted based on a reference region like the extraction unit 303, but is different in that it is not extracted based on the subject distance.
[0043] The subject region candidates may have a pixel structure corresponding to the captured image, for example, and may be configured by storing logical information about whether each pixel belongs to a region of a human outline determined based on a face region. Hereinafter, the information about the subject region candidates extracted by the estimation unit 304 will be referred to as a second subject map.
[0044] The evaluation unit 305 evaluates the effectiveness of the first object map configured based on the distance distribution of the object. In the digital camera 100 of this embodiment, the first object map extracts an area from the entire captured image based on the defocus amount of the reference area, so the evaluation unit 305 performs evaluation based on information related to the reference area in the defocus map.
[0045] <Effectiveness of the first subject map> Hereinafter, a method for evaluating the effectiveness of the first object map performed in image processing unit 107 of this embodiment when determining the object region will be described in further detail with reference to the drawings. In this description, an example will be given in which the objects are distributed in the imaging range as shown in Fig. 6. In Fig. 6, the imaging range includes a human object 601 to be determined as the main object in this embodiment, a tree 602 located farther from digital camera 100 than the human object 601, and ground 603 extending from in front of the human object 601 to beyond the tree 602.
[0046] When an image is captured under favorable conditions for such an imaging range, a defocus map is obtained, for example, as shown in Fig. 7(a). In order to facilitate understanding of the invention, the defocus map illustrated in Fig. 7(a) is visualized by converting the defocus amount, which is a pixel value, into grayscale. In the example of Fig. 7(a), pixels closer to the subject distance are shown in a color closer to white (high pixel value), and pixels farther away are shown in a color closer to black (low pixel value).
[0047] At this time, the histogram of the defocus amount becomes as shown in Fig. 8(a), and the extraction unit 303 specifies a value range that includes the average value dr of the defocus amount in the reference region 701 and indicates the frequency of consecutively exceeding the threshold value 801. That is, the extraction unit 303 specifies the minimum defocus amount d1 and the maximum defocus amount d2 as values shown based on the histogram. Then, the extraction unit 303 extracts pixels that indicate the defocus amounts indicated by these values, thereby obtaining a first subject map in which the image of the human subject 601 is suitably set as a corresponding region as shown in Fig. 9(a).
[0048] On the other hand, imaging may be performed under imaging conditions different from the above-mentioned preferable conditions, such as when the shooting scene is a backlit scene such as at dusk, where the ISO sensitivity must be increased. In the captured image (including images A and B) obtained by the imaging, contrast may be reduced in areas such as the cheeks and forehead of the human subject 601, monochromatic clothing, and the sky, and as a result, characteristic elements in the subject image may not be easily seen. Furthermore, imaging at a high sensitivity setting may cause noise to be included in the captured image. Therefore, even if the generating unit 300 derives a defocus amount based on such a captured image, the derivation accuracy may be reduced, and the generated defocus map may have a form such as that shown in FIG. 7(b). In the example of the figure, a pixel from which a defocus amount with low reliability is derived due to low contrast (not showing a predetermined contrast) is shown as a shaded pixel 712. Furthermore, a pixel that is not determined to be low contrast but shows a defocus amount different from that of surrounding pixels due to the influence of noise contained in the captured image (the difference in defocus amount is steep) is shown as pixel 713. In the following description, the former will be referred to as a low-reliability pixel, and the latter as an error pixel. Note that information on whether a pixel in the defocus map is a low-reliability pixel or an error pixel may be determined by the generation unit 300 when deriving the defocus amount, and may be stored in association with the defocus map.
[0049] Therefore, for the defocus map obtained in this way, the average value dr derived from the defocus amount in the reference region 711 differs from that obtained under suitable imaging conditions due to the defocus amount of the low-reliability pixel or the error pixel. In addition, since the histogram of the defocus amount also differs as shown in FIG. 8(b), the value range indicating the frequency of exceeding the threshold value 801 specified by the extraction unit 303 also changes. As a result, when pixels in the value range defined by the minimum defocus amount d1 and the maximum defocus amount d2 in FIG. 8(b) are extracted, the first object map as shown in FIG. 9(b) is obtained. In the illustrated first object map, the image of the human object 601 is not shown as a corresponding area, and it can be said that the extraction result of the object area is not suitable.
[0050] In this way, the first object map constructed based on the defocus map may be configured such that the desired object region cannot be specified depending on the imaging conditions, and therefore, in this embodiment, the evaluation unit 305 evaluates its validity. The validity may be quantitatively indicated, for example, as the ratio of pixels (valid pixels) showing a reliable defocus amount in the reference region of the defocus map, that is, the ratio of pixels excluding low-reliability pixels and error pixels. In the example of FIG. 7(b), the reference region 711 is 5 pixels wide by 4 pixels long = 20 pixels, of which the number of low-reliability pixels 712 is 10 and the number of error pixels 713 is 2, so the number of valid pixels is 9. Therefore, the validity is 9 / 20 = 0.45. Note that, in this embodiment, the pixels excluding the low-reliability pixels and error pixels are described as being treated as valid pixels, but, for example, depending on the imaging conditions, at least one of these may be excluded to set valid pixels.
[0051] The determination unit 306 determines the subject area to be subjected to the image effect processing based on a map formed by composing the first subject map and the second subject map. In the image processing unit 107 of this embodiment, the compositing of the first subject map and the second subject map is performed by weighting and adding these maps based on the effectiveness of the first subject map. The weight may be set based on a graph as shown in FIG. 10, for example. In the example of the figure, the contribution rate of the second subject map to the effectiveness of the first subject map is shown as a percentage. In the aspect in which the defocus map is as shown in FIG. 7(b), the effectiveness of the first subject map is 0.45, so according to the graph, the determination unit 306 determines the subject area based only on the second subject map. That is, when the first subject map is as shown in FIG. 11(a) and the second subject map is as shown in FIG. 11(b), the result of subject map compositing (not necessarily compositing depending on the weight) is as shown in FIG. 11(c). In this case, the determining unit 306 determines the area specified based on the position and size of the reference area as the final subject area.
[0052] The effect processing unit 307 performs processing to change the brightness of the subject region in the captured image to be processed, which has been determined by the determination unit 306. As described above, in the image processing unit 107 of this embodiment, the effect processing unit 307 is described as performing processing to change the brightness of the subject region, but the processing content of the effect processing unit 307 may be any.
[0053] Image effect processing The image effect processing of the image processing unit 107 of this embodiment having such a configuration will be specifically described with reference to the flowchart in Fig. 12. The processing corresponding to the flowchart can be realized by the system control unit 101 reading out a corresponding processing program stored in, for example, ROM 102, developing it in RAM 103, and executing it to control the operation of the image processing unit 107. This image effect processing will be described as being started when an instruction is given to change the brightness (illumination) state of a human subject for a captured image stored in, for example, recording medium 108.
[0054] In S1201, the generating unit 300 generates a defocus map corresponding to the target image based on the image A and image B related to the target image. In this embodiment, the captured image stored in the recording medium 108 is stored in association with the image A and image B acquired at the time of capturing. The generating unit 300 stores the generated defocus map in, for example, the RAM 103. At this time, the generating unit 300 also determines whether or not each pixel corresponds to a low reliability pixel or an error pixel based on the defocus amount derived for that pixel.
[0055] In S1202, the configuration unit 302 configures a histogram of the defocus amount based on the defocus map generated in S1202. The configured histogram may be stored in the RAM 103, for example.
[0056] In S1203, the detection unit 301 detects a person's face area in the target captured image (target image). More specifically, the detection unit 301 detects a face area included in the target image, and outputs information on the position (coordinates) and size of the detected face area in the target image. Furthermore, the image processing unit 107 sets a reference area for the target image based on the face detection result by the detection unit 301, and controls so as to hold the reference area during this image effect processing.
[0057] In S1204, the extraction unit 303 derives an average value dr of the defocus amount for the object in the reference region. More specifically, the extraction unit 303 derives the average value dr of the defocus amount by referring to the pixels in the reference region of the defocus map. The extraction unit 303 also specifies a value range of the defocus amount to be extracted based on the derived average value dr and the histogram configured in S1203. Then, the extraction unit 303 configures a first object map indicating the arrangement of pixels included in the value range based on the information of the specified value range and the histogram, and stores the first object map in, for example, RAM 103.
[0058] In S1205, the evaluation unit 305 evaluates the validity of the first object map generated in S1204. More specifically, the evaluation unit 305 identifies the number of valid pixels based on the number of low-reliability pixels and error pixels included in the reference region of the defocus map, derives the ratio of the valid pixels in the reference region, and stores the ratio in, for example, the RAM 103 as information on the validity.
[0059] In S1206, the estimation unit 304 estimates an area in the target image where the image of the person is likely to appear, based on the face detection result in S1203. More specifically, the estimation unit 304 estimates which pixels in the target image the image of the person will appear in by enlarging or reducing information on a predetermined person's outline according to the size of the detected face area, and further arranging the information in a position according to the face area. That is, the estimation unit 304 estimates a group of pixels contained in the outline as the area where the image of the person is likely to appear. Then, the estimation unit 304 forms a second subject map based on the information on the estimated area, and stores it in, for example, RAM 103.
[0060] In S1207, the determination unit 306 combines the first and second object maps based on the information on the effectiveness derived in S1205, and determines the object region to be subjected to this image effect processing. More specifically, the determination unit 306 sets a combination ratio (contribution rate) of the first object map corresponding to the effectiveness based on the graph in Fig. 11(a), combines the first and second object maps, and determines the object region based on the information indicated by the combined map.
[0061] In S1208, the effect processing unit 307 performs a process of performing brightness correction on the subject area determined in S1207. In this brightness correction, for example, if the pixel value of each pixel in the target image is X and the pixel value of the pixel in the composite map indicating the subject area is G, the pixel value Y of the pixel after correction is Y = X (1+G / 255) This brightness correction adds a lighting correction effect as if the person, who is the main subject, is illuminated. The effect processing unit 307 records the image to which the image effect processing has been applied on the recording medium 108, and this image effect processing is completed.
[0062] As described above, the image processing device of this embodiment can suitably specify the subject area and, for example, add a desired effect to the subject area. More specifically, the image processing device detects a person's face area in the target image, and creates a first subject map in which the subject area is specified based on the defocus map and the face area, and a second subject map in which the subject area is specified based on the fact that the subject is a person and the face area. The image processing device then evaluates the effectiveness of the former map, and combines these maps to determine the subject area in which the image of the subject person appears. This allows a suitable image effect to be added to the image of the subject even if the target image is low contrast or contains noise.
[0063] In this embodiment, the face area of a person is detected as the reference area as the main subject, but the present invention is not limited to this. The detection may be, for example, a detection of other parts of a person, or may be a detection of other types of subjects such as a passenger car, a pet, or a plant as the main subject based on at least some of their characteristics. In addition, the selection of the subject to be the main subject is not limited to such an image analysis, but may be based on, for example, a selection operation by the user.
[0064] In the present embodiment, the first object map is constructed by extracting a value range that indicates a frequency of exceeding a predetermined threshold value 801 in the defocus amount histogram. However, the threshold value does not need to be a fixed value. For example, the defocus amount (dmax) that has the highest frequency may be searched for among the defocus amounts near the average value dr of the defocus amounts in the reference area, and M% (M is an arbitrary number) of the frequency may be set as the threshold value. By configuring in this way, the threshold value becomes relatively strict when extracting an object whose defocus amount is concentrated at dmax, so that it is possible to reduce the possibility of other objects being mixed in. In addition, when an object extending in the depth direction exists, the shape of the histogram becomes broad, but the threshold value becomes loose, so that the object can be extracted without omission, and the robustness of the extraction accuracy for the scene can be improved.
[0065] Here, it is preferable to determine the range of the defocus amount for searching dmax according to the size of the reference area. That is, when the reference area is large, the defocus amount of the subject area may spread over a wide range, so the search range for dmax may be widened. Conversely, when the reference area is small, the range for searching dmax may be narrowed to prevent mixing of areas in which images of different subjects appear. Furthermore, when the result of specifying the range of the defocus amount starting from dmax does not include the average value dr of the defocus amount of the reference area, the value range to be extracted may be widened to include the average value dr.
[0066] In this embodiment, the first object map is constructed by extracting the range of defocus amounts with a frequency exceeding a predetermined threshold from the histogram using the average defocus amount dr of the reference area as a reference, but the present invention is not limited to this. For example, in order to reduce the processing load, the face area and the body area may be set as the reference area, and the minimum defocus amount d1 and the maximum defocus amount d2 may be determined based on the defocus amount distributed in the reference area.
[0067] In the present embodiment, the evaluation of the validity is described as being derived based on the valid pixels of the face region set as the reference region, but the implementation of the present invention is not limited to this. Since human images tend to have low contrast and low reliability pixels, particularly around the forehead and neck, the evaluation of validity may be performed by vertically expanding the target reference region from the size of the face region in order to take these into consideration. In other words, the determination of validity may be performed by expanding the reference region according to the type of the detected subject.
[0068] In addition, in this embodiment, the second subject map is constructed after adjusting the information of a predetermined shape indicating the outline of a person based on the position and size of the detected face area, but the embodiment of the present invention is not limited to this. For example, in order to absorb individual differences of subjects, the facial organ positions, joint positions, posture information, etc. of the human subject 601 may be detected and transformed into a shape that matches the human subject.
[0069] In this embodiment, the type of subject detected as the main subject is a person, and therefore the second subject map is configured based on the external shape of a person, but the present invention is not limited to this. That is, it goes without saying that the shape used to configure the second subject map may be different depending on the type of subject detected for the reference area. In addition, a method such as semantic area division based on machine learning may be adopted to identify the shapes of people, passenger cars, pets, plants, etc. to configure the second subject map.
[0070] In addition, in this embodiment, the method of determining the final object region based on the effectiveness of the first object map has been described, but the implementation of the present invention is not limited to this. For example, under imaging conditions in which the proportion of the main object in the angle of view is small (such as a long distance to the main object, or a wide-angle lens being used), that is, imaging conditions in which the depth of field is deep, the resolution of the defocus map may be reduced. Under such conditions, the accuracy of extracting the image of the main object based on the defocus amount may be reduced. Also, for example, when the number of pixels of the reference area in the captured image is small, the number of samples used to derive the effectiveness is reduced, and as a result, there is a possibility that appropriate effectiveness is not derived. Therefore, when the size of the reference area is smaller than a predetermined size, the determination unit 306 may be controlled to increase the weight of the second object map in the synthesis of maps related to the determination of the object region. Alternatively, when the size of the reference area is smaller than a predetermined size, the evaluation unit 305 may be controlled to decrease the weight of the first object map in the synthesis of maps related to the determination of the object region.
[0071] In the present embodiment, the image effect processing is described as applying image processing for brightness correction to the subject area determined based on the first subject map and the second subject map, but the present invention is not limited to this. In the present invention, the content of the applied image processing may be sharpness adjustment, contrast adjustment, etc., and the area to which the image processing is applied may not be the subject area, but may be an area other than the subject area. The present invention is applicable as long as it identifies the subject area and performs different types of image processing on the subject area and outside the subject area (including not performing image processing on either one of the areas).
[0072] In the present embodiment, the digital camera 100 has an image sensor having a distance measuring function based on an image plane phase difference distance measuring method, and generates a defocus map by acquiring a group of images having a parallax relationship with the captured image, but the present invention is not limited to this. Distance information related to the imaging range does not have to be acquired simultaneously with the captured image, and may be recorded in advance on the recording medium 108 or the like.
[0073] In the present embodiment, the defocus map is described as being generated based on a group of images that are in a parallax relationship, but the method is not limited to this as long as it corresponds to the captured image and can acquire the distance distribution of the subject in the captured range. The defocus map generation method may be, for example, a DFD (Depth From Defocus) method that derives the defocus amount from the correlation of two images with different focus or aperture value. Alternatively, the distance distribution of the subject may be derived using information related to the distance distribution obtained from a distance measurement sensor module such as a TOF (Time of Flight) method. Alternatively, it may be a contrast distance measurement method. Regardless of the distance distribution obtained by any method, the present invention can be realized in the same way by combining the alternative silhouette with the distance distribution according to the effectiveness of the target subject area in the distance distribution.
[0074] In addition, in this embodiment, the configuration of the first object map has been described, and an aspect in which a defocus map showing the distance distribution of objects included in the imaging range is referred to has been described, but the present invention is not limited to this. The information showing the distance distribution of the object may be two-dimensional information configured by storing values such as the shift amount (image shift amount) obtained in the process of deriving the defocus amount for the image of each pixel of the captured image, and the object distance based on the defocus amount. In the former case, it is not necessary to hold the pixel pitch PY of the image sensor or the conversion coefficient KX determined by the opening angle of the center of gravity of the light beam passing through a pair of ranging pupils, and the amount of information can be reduced. In the latter case, since the values are numerical values that are easy for the user to grasp, it is possible to present to the user what kind of image is generated by, for example, presenting them via the display unit 109 in the process of processing. In addition, a mode in which two-dimensional information storing a value normalized by the defocus amount with the focal depth (for example, 1Fδ, where F is the aperture value and δ is the permissible circle of confusion diameter) may be referred to. Here, the aperture value F may be a fixed value across the entire surface with the aperture value near the center of the image height as a representative value, or an aperture value distribution may be applied that takes into account the fact that aperture values at peripheral image heights become darker due to vignetting in the optical system.
[0075] In addition, in the present embodiment, the aspect of referring to the defocus map in relation to the configuration of the first object map has been described, but the present invention is not limited to this. The information referred to in relation to the configuration of the first object map may be information (classification information) in which the object corresponding to each pixel of the target image is classified according to a predetermined criterion, and is configured based on the target image or an image captured in relation to the target image (image A and image B, etc.). The classification information is preferably two-dimensional information having a pixel structure similar to that of the captured image, and may be configured by storing the classification result for the object of each pixel of the target image in the pixel at the same position. Here, there are multiple classifications, and the order of these classifications is determined according to a predetermined criterion related to the classification, such as size or pixel value. Therefore, the classification information is not limited to information indicating the object distance, and may be motion vector information (optical flow) indicating the distribution of motion vectors based on the change over time of the image of the object obtained based on the captured images captured continuously. Alternatively, the classification information may be color labeling information (color distribution, color label map) in which the color of the image of the object is labeled based on the color information of the target image. Alternatively, the referenced two-dimensional information may be an object map based on semantic region segmentation based on machine learning, etc. When using semantic region segmentation, a different method must be used to construct the second object map, but a method that is more robust to scene changes, such as using a fixed shape map of a human figure, may be selected.
[0076] In the present embodiment, an example has been described in which the digital camera 100, which is an imaging device with an imaging function, is equipped with functions for determining a subject area and performing image effect processing, but it will be easily understood that the present invention is not limited to this. The present invention can be implemented by any device configured to be able to acquire a captured image and classification information that classifies the image of a subject related to each pixel of the captured image, and can also be implemented by using an imaging system having an imaging device and an image processing device.
[0077] The invention is not limited to the above-described embodiments, and various modifications and variations are possible without departing from the spirit and scope of the invention. Accordingly, the following claims are appended to apprise the public of the scope of the invention.
[0078] [Other embodiments] The present invention can also be realized by a process in which a program for implementing one or more of the functions of the above-described embodiments is supplied to a system or device via a network or a storage medium, and one or more processors in a computer of the system or device read and execute the program. The present invention can also be realized by a circuit (e.g., ASIC) that implements one or more of the functions. [Explanation of symbols]
[0079] 100: digital camera, 101: system control unit, 102: ROM, 103: RAM, 104: optical system, 105: imaging unit, 106: A / D conversion unit, 107: image processing unit, 108: recording medium, 109: display unit, 110: operation input unit, 111: bus, 200: pixel, 201: microlens, 202: pupil division pixel, 300: generation unit, 301: detection unit, 302: configuration unit, 303: extraction unit, 304: estimation unit, 305: evaluation unit, 306: determination unit, 307: effect processing unit
Claims
1. An acquisition means for acquiring classification information for classifying objects related to each pixel of a captured image; A setting means for setting a reference region in the captured image; a first configuration means for configuring a first object map indicating an area in the captured image in which an image of the object related to the reference area appears based on the classification information; a second configuration means for configuring a second object map indicating an area in the captured image in which an image of the object related to the reference area appears, without being based on the classification information; an evaluation means for evaluating the validity based on information indicated by the first object map; a determining means for determining a subject region based on at least one of the first subject map and the second subject map based on the evaluation by the evaluating means; an execution unit that executes different image processing on the subject area of the captured image and an area other than the subject area; having The image processing apparatus according to claim 1, wherein the determining means is involved in determining the subject region and changes a contribution rate of the first subject map based on an evaluation by the evaluating means.
2. the classification information is information obtained by classifying a subject related to each pixel by referring to the captured image or an image captured corresponding to the captured image, The evaluation means evaluates the validity of the first object map based on an image referred to in the classification of the object related to each pixel.
2. The image processing device according to claim 1,
3. The image processing device according to claim 2 , wherein the evaluation means evaluates the effectiveness of the first object map based on a ratio of valid pixels contained in the reference area of the image referred to in classifying the object related to each pixel.
4. The image processing apparatus according to claim 3 , wherein the evaluation means, when evaluating the effectiveness of the first object map, expands the reference area in accordance with the type of the object related to the reference area.
5. 5. The image processing device according to claim 3, wherein the effective pixels are pixels excluding at least one of pixels not exhibiting a predetermined contrast and pixels exhibiting noise from an image referenced for classification of the subject related to each pixel.
6. The image processing device according to any one of claims 2 to 5, characterized in that the classification information is any one of distance information indicating a distribution of subject distance in the depth direction, motion vector information indicating a distribution of motion vectors based on changes in the image of the subject over time, color labeling information indicating a color distribution of the image of the subject, and information obtained by semantic region segmentation using machine learning.
7. The classification information includes a plurality of classifications in which a hierarchy is determined, 7. The image processing device according to claim 2, wherein the first configuration means configures the first object map so that pixels included in a range of consecutive classifications that include a classification to which the reference area corresponds and that show a frequency exceeding a predetermined threshold, among the frequency distributions for each classification of the classification information, are regarded as an area in which an image of a subject related to the reference area appears.
8. 8. The image processing apparatus according to claim 2, wherein the evaluation means evaluates the reference region so that the smaller the size of the reference region, the lower the effectiveness of the reference region.
9. The image processing device according to any one of claims 1 to 8, characterized in that the second construction means constructs the second subject map so that an area of a predetermined shape for a type of subject related to the reference area is an area in which an image of the subject related to the reference area appears.
10. the subject related to the reference area is a person, the setting means includes a detection means for detecting a face area of a person included in the captured image, The second configuration means configures the second subject map so that a region having a shape of a human outline including the reference region is a region in which an image of the subject related to the reference region appears.
10. The image processing device according to claim 9,
11. An imaging means for capturing the captured image; An image processing device according to any one of claims 1 to 10, An imaging device comprising:
12. An image processing method executed by an image processing device on a captured image, comprising: an acquisition step of acquiring classification information for classifying objects related to each pixel of the captured image; a setting step of setting an area in which a part of an image of a predetermined type of subject included in the captured image appears as a reference area; a first construction step of constructing a first object map indicating an area in the captured image in which an image of the object related to the reference area appears based on the classification information; a second construction step of constructing a second object map indicating an area in the captured image in which an image of the object related to the reference area appears, without being based on the classification information; an evaluation step of evaluating the validity based on information indicated by the first object map; a determining step of determining a subject region based on at least one of the first subject map and the second subject map based on the evaluation in the evaluating step; an execution step of executing different image processing on the subject region of the captured image and a region other than the subject region; having An image processing method, comprising: in said determining step, changing a contribution rate of said first object map to the determination of said object region based on the evaluation in said evaluating step.
13. A program for causing a computer to function as each of the means of the image processing apparatus according to any one of claims 1 to 10.
Citation Information
Patent Citations
Image pickup device, image processor and image processing method
JP2008015754A
Imaging apparatus and its control method
JP2009055125A
Subject tracking device, optical device, imaging device, control method of object tracking device, and program
JP2016213744A
Image processing system, image processing method and program
JP2017204673A
Image processing apparatus, control method for the same, and imaging apparatus
JP2017229061A
