WO2013089051A1 - Image processing device, image processing method, image processing program, and recording medium storing image processing program - Google Patents

Image processing device, image processing method, image processing program, and recording medium storing image processing program Download PDF

Info

Publication number
WO2013089051A1
WO2013089051A1 PCT/JP2012/081888 JP2012081888W WO2013089051A1 WO 2013089051 A1 WO2013089051 A1 WO 2013089051A1 JP 2012081888 W JP2012081888 W JP 2012081888W WO 2013089051 A1 WO2013089051 A1 WO 2013089051A1
Authority
WO
WIPO (PCT)
Prior art keywords
region
area
image processing
pixel
equal
Prior art date
Application number
PCT/JP2012/081888
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 WO2013089051A1 publication Critical patent/WO2013089051A1/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/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • 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/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Definitions

  • the present invention relates to an image processing device that extracts a region of a specific part of an object represented by an input image from an input image, and more specifically, an image processing device suitable for extracting a region with a small change between pixels,
  • the present invention relates to an image processing method, an image processing program, and a recording medium storing the image processing program.
  • Patent Document 1 discloses a method for determining a region of interest in a skin pattern image.
  • the region of interest refers to a region including, for example, a fingerprint.
  • values in the first value range (dark range) in the image are assigned to ridges
  • values in the second value range (light range) are assigned to valleys
  • the entire image Is shifted in the direction of the first value range.
  • the average value of the shift values for the individual tiles is compared with the reference value.
  • a tile whose average value is shifted in the first direction with respect to the reference value is regarded as a region of interest.
  • Patent Document 2 discloses a system that adjusts the white balance of an image using the face color as a reference signal. That is, this system detects a face with a face detector and extracts skin color from the face. Then, the skin color is used for white balance adjustment.
  • Patent Document 1 it is difficult to extract an area where there is no pattern such as a fingerprint, that is, an area where the pixel change is small.
  • a luminance-based face detection algorithm is used. For example, if a recognition technique such as SVM (Support Vector Vector Machine) is used, the entire face can be extracted. However, the cost is high, and in this case, an area with a small pixel change other than the face such as a blue sky or the sea is extracted. Not eligible.
  • SVM Small Vector Vector Machine
  • a relatively inexpensive cost recognition technique is used, a part of the target area to be extracted such as a face may be missing and extracted. Such omission can be a cause of malfunction when performing predetermined image processing (for example, face recognition or face color correction) using the extracted target region.
  • an object of the present invention is to provide an image processing apparatus, an image processing method, an image processing program, and a recording medium storing the image processing program, which can extract an area with a small pixel change from an image at low cost.
  • a first aspect of the present invention is an image processing apparatus that extracts a target region from an input image
  • a seed region extraction unit that extracts, as a seed region, a region that satisfies at least conditions relating to a predetermined range of luminance, saturation, and hue from the input image; It is determined whether or not the gradients of luminance, saturation, and hue in the peripheral region of the seed region are less than or equal to a first threshold for luminance, saturation, and hue, respectively, and the gradient is less than or equal to the first threshold.
  • the region determined to be included in the target region and whether or not the gradient in the region around the region newly included in the target region is equal to or less than the first threshold value is determined. Including an area determined to be equal to or less than a first threshold, and an area expansion unit that acquires the area where the gradient is equal to or less than the first threshold and the seed area as the target area.
  • the region expanding unit may determine whether or not the gradient is equal to or less than a first threshold, using each pixel in the seed region as a starting point.
  • the area extension is Using each pixel in the seed region as a pixel of interest, it is determined whether or not the gradient in the surrounding pixels of the pixel is equal to or less than the first threshold value. If the determination result is equal to or less than the first threshold value, the pixel to be determined A first expansion process for including A pixel newly included in the target region is set as a pixel of interest, and it is determined whether or not the gradient of pixels around the pixel is equal to or less than the first threshold. If the determination result is equal to or less than the first threshold, the determination is made. And a second extension process for repeatedly including the target pixel in the target area.
  • the seed region extraction unit extracts a region that further satisfies a condition that the gradient is equal to or less than a predetermined value as the seed region.
  • the predetermined value is a second threshold value smaller than the first threshold value.
  • the seed region extraction unit selects a region that satisfies a first predetermined condition regarding the area from the plurality of regions. It is characterized by extracting as a region.
  • a seventh aspect of the present invention is the sixth aspect of the present invention.
  • the first predetermined condition relating to the area is a condition that the area is maximum among a plurality of regions that satisfy the conditions relating to the luminance, saturation, and hue ranges.
  • the first predetermined condition regarding the area is a condition that the area is a predetermined value or more.
  • a ninth aspect of the present invention is the eighth aspect of the present invention,
  • the region expansion unit obtains a plurality of regions each composed of the region determined to have the gradient equal to or less than the first threshold and the seed region
  • the region expansion unit A region satisfying the predetermined condition of 2 is set as a target region to be extracted.
  • the second predetermined condition regarding the area is a condition that the area is the maximum among the plurality of regions.
  • the image processing apparatus further includes a correction unit that performs a predetermined correction process on the target area acquired by the area expansion unit.
  • a twelfth aspect of the present invention is the eleventh aspect of the present invention
  • the predetermined correction process is a process of including, in the target area, an area whose area is equal to or less than a predetermined value among the areas that are not the target area in contact with the inner periphery of the target area acquired by the area expanding unit.
  • the input image is indicated by a luminance signal and a color difference signal.
  • a fourteenth aspect of the present invention is the thirteenth aspect of the present invention.
  • the image processing apparatus further includes a signal format conversion unit that converts an input image indicated by a primary color signal into the input image indicated by a luminance signal and a color difference signal.
  • a fifteenth aspect of the present invention is an image processing method for extracting a target region from an input image
  • a seed region extraction step for extracting, from the input image, a region that satisfies at least the conditions relating to the predetermined luminance, saturation, and hue range as a seed region; It is determined whether or not the gradients of luminance, saturation, and hue in the peripheral region of the seed region are less than or equal to a first threshold for luminance, saturation, and hue, respectively, and the gradient is less than or equal to the first threshold.
  • the region determined to be included in the target region and whether or not the gradient in the region around the region newly included in the target region is equal to or less than the first threshold value is determined.
  • a sixteenth aspect of the present invention is the fifteenth aspect of the present invention, In the region expansion step, the determination as to whether or not the gradient is equal to or less than a first threshold value is performed starting from each pixel in the seed region.
  • a seventeenth aspect of the present invention is the sixteenth aspect of the present invention.
  • the region expansion step includes Using each pixel in the seed region as a pixel of interest, it is determined whether or not the gradient in the surrounding pixels of the pixel is equal to or less than the first threshold value. If the determination result is equal to or less than the first threshold value, the pixel to be determined A first expansion step of including in the region of interest; A pixel newly included in the target region is set as a pixel of interest, and it is determined whether or not the gradient of pixels around the pixel is equal to or less than the first threshold. If the determination result is equal to or less than the first threshold, the determination is made. And a second extension step of repeatedly including the target pixel in the target region.
  • An eighteenth aspect of the present invention is an image processing program, A computer is caused to execute each step in the image processing method according to any one of the fifteenth to seventeenth aspects of the present invention.
  • a nineteenth aspect of the present invention is a computer-readable recording medium, An image processing program according to an eighteenth aspect of the present invention is recorded.
  • an expansion process (with a gradient equal to or less than the first threshold value) is performed based on a seed region that satisfies at least conditions relating to predetermined luminance, saturation, and hue ranges.
  • a process of determining whether or not there is and adding a region satisfying this to the target region) is performed.
  • the target area includes an area that should have been extracted by the expansion process but was not extracted as a seed area. For this reason, it is possible to extract almost the entire target region without missing the target region to be extracted. Accordingly, various image processing such as face recognition or face color correction can be appropriately performed using the extracted target region. Further, since high-cost recognition technology such as SVM (Support Vector Vector Machine) is not used, cost reduction can be achieved.
  • the conditions relating to the gradient are determined using each pixel in the seed region as a starting point, and thus the same as the first aspect or the fifteenth aspect of the present invention. An effect can be obtained.
  • a condition is added in which the brightness, saturation, and hue gradient are equal to or less than predetermined values. For this reason, a region having a large gradient, that is, a region other than a region having a small pixel change such as a face can be excluded from the seed region. For this reason, the extraction accuracy of the target region can be increased.
  • the conditions of the brightness, saturation, and hue gradient in the seed region extraction process are set more strictly than the conditions of the brightness, saturation, and hue gradient in the expansion process. Is done. For this reason, regions other than regions with small pixel changes, such as faces, can be more reliably excluded from the seed region. As a result, a more accurate seed region (that is, with less noise) can be used in the expansion process, and thus the extraction accuracy of the target region can be further increased.
  • the same effect as any of the first to third aspects of the present invention is obtained by extracting a region that satisfies the first predetermined condition regarding the area as a seed region. Can be obtained.
  • the condition that the area is the maximum among the plurality of regions that satisfy the conditions of the luminance, saturation, and hue ranges is set as the first predetermined condition relating to the area. The same effect as that of the sixth aspect of the present invention can be obtained.
  • the same effect as that of the sixth aspect of the present invention can be obtained by setting the condition that the area is equal to or greater than a predetermined value as the first predetermined condition relating to the area. .
  • a plurality of seed regions can be extracted. For this reason, for example, a plurality of faces can be extracted from an image in which a plurality of faces are depicted.
  • an unnecessary target region can be excluded by setting a target region to be extracted as a target region that satisfies the second predetermined condition regarding the area.
  • the same effect as that of the ninth aspect of the present invention is obtained by setting the condition that the area is the largest among the plurality of target regions as the second predetermined condition regarding the area. Can be obtained.
  • the omission of the target region to be extracted can be further suppressed by the correction process.
  • the thirteenth aspect of the present invention in the case of extracting a target area from an image indicated by image data obtained by receiving a television broadcast or obtained from a video system, for example, The same effect as the third aspect can be obtained.
  • the fourteenth aspect of the present invention for example, when the target area is extracted from the image indicated by the image data received from the multimedia system, the same effect as that of the first aspect or the third aspect of the present invention is obtained. be able to.
  • (C) is a figure which shows the processing result which extracted the seed area
  • (D) is a figure which shows the result of having performed the expansion process.
  • (E) is a figure which shows the result of having performed the hole-filling process.
  • C r C b coordinate a diagram schematically showing a range of saturation and hue related skin tone. It is a flowchart which shows the detail of step S3 in FIG. It is a flowchart which shows the detail of step S33 in FIG. It is a figure for demonstrating the example of the expansion process in the said 1st Embodiment. It is a figure for demonstrating the example of the expansion process in the said 1st Embodiment.
  • FIG. 1 It is a figure for demonstrating the example of the expansion process in the said 1st Embodiment. It is a schematic diagram for demonstrating the expansion process object in the said 1st Embodiment.
  • A is a schematic diagram when four adjacent pixels are subject to expansion processing.
  • B is a schematic diagram in the case where 8 neighboring pixels are subject to expansion processing. It is a figure which shows the filter used for calculation of the gradient in the said 1st Embodiment.
  • A) is a figure which shows the Roberts filter of a 45 degree direction.
  • (B) is a figure which shows the Roberts filter of a 135 degree direction.
  • C is a figure which shows the pre-wit filter of a horizontal direction.
  • (D) is a diagram showing a pre-wit filter in the vertical direction.
  • (E) is a figure which shows the Sobel filter of a horizontal direction.
  • (F) is a figure which shows the Sobel filter of a perpendicular direction.
  • A is a figure which shows a sample image.
  • B is a diagram showing a processing result of extracting a designated color region.
  • C is a figure which shows the processing result which extracted the seed area
  • (D) is a figure which shows the result of having performed the expansion process.
  • (E) is a figure which shows the result of having performed the hole-filling process. It is a block diagram which shows the functional structure of the principal part of the image processing apparatus which concerns on the 3rd Embodiment of this invention.
  • FIG. 1 is a block diagram illustrating a hardware configuration of the image processing apparatus according to the present embodiment.
  • the image processing apparatus includes a CPU 1, an input unit 2, a memory 3, a hard disk device 4, and an output unit 5.
  • the hard disk device 4 stores an image processing program 6 for causing the CPU 1 to execute the edge enhancement processing according to the present embodiment.
  • the image processing program 6 may be read and installed by a DVD drive or the like (not shown) from a recording medium such as a DVD-ROM storing the image processing program 6, or supplied via a network (not shown) It can be installed.
  • the input image data ID included in the input image signal is input to the image processing apparatus from the outside via the input unit 2.
  • the input image data ID indicates an input image.
  • the memory 3 temporarily stores the input image data ID and the image processing program 6 read from the hard disk device 4.
  • the CPU 1 stores the input image data ID and the image processing program 6 based on the input image data ID and the image processing program 6.
  • Extracted data ED indicating a target region that is a region of a specific portion (for example, a face in the present embodiment) of the target object expressed by the input image is generated.
  • the generated extracted data ED is output to the outside via the output unit 5.
  • FIG. 2 is a block diagram illustrating a functional configuration of a main part of the image processing apparatus according to the present embodiment.
  • the image processing apparatus includes a seed region extraction unit 10, a region expansion unit 20, and a correction unit 30.
  • This image processing apparatus extracts a target region from an image indicated by image data obtained by receiving a television broadcast or obtained from a video system. Therefore, the input image data ID in the present embodiment is luminance data (hereinafter also simply referred to as “luminance”) Y as a luminance signal, first color difference data C b as a first color difference signal, and second as a second color difference signal. It consists of color difference data Cr .
  • the first color difference data Cb is color difference data representing a difference between the blue component in the input image and the luminance data Y.
  • the second color difference data C r is the color difference data representing the difference between the red component and the luminance data Y in the input image.
  • the input image data ID is given to the seed region extraction unit 10 and the region expansion unit 20.
  • Seed region extraction unit 10 from the first color difference data C b and the second color difference data C r of the input image data ID received, obtains the saturation r and hue ⁇ by the following equation (1).
  • FIG. 3 is a diagram schematically showing the positional relationship of each color in the C r Cb coordinates.
  • the seed region extraction unit 10 extracts a region satisfying predetermined ranges of luminance Y, saturation r, and hue ⁇ as a seed region, and stores seed region data SD indicating the seed region in the region expansion unit 20. give.
  • the region expansion unit 20 uses the first color difference data C b and the second color difference data C r in the received input image data ID to calculate the saturation r and the hue ⁇ using Equation (1). Ask for. Note that the calculation of the saturation r and the hue ⁇ may be performed by the seed region extraction unit 10 and the region expansion unit 20 in common.
  • the area expansion unit 20 acquires, as target areas, a seed area indicated by the seed area data SD and an area obtained by an expansion process described later based on the seed area. It should be noted that it is actually desirable to perform a predetermined correction process by the correction unit 30 on the target region acquired by the region expansion unit 20.
  • the target area acquired by the area expansion unit 20 is hereinafter referred to as “target area before correction”, and after correction processing acquired by the correction unit 30.
  • This target area is referred to as a “target area after correction”.
  • the area expanding unit 20 provides the correction unit 30 with the pre-correction target area data EDc indicating the pre-correction target area.
  • the correction unit 30 performs a predetermined correction process on the pre-correction target area indicated by the pre-correction target area data EDc, thereby obtaining the post-correction target area, and outputs extracted data ED indicating the acquired target area to the outside.
  • FIG. 4 is a flowchart of the image processing program in the present embodiment. Steps S1 and S2 correspond to the seed region extraction unit 10, step S3 corresponds to the region expansion unit 20, and step S4 corresponds to the correction unit 30.
  • the seed region extraction unit 10, the region expansion unit 20, and the correction unit 30 are realized in software by the CPU 1 executing each step of the image processing program shown in FIG.
  • FIG. 5 is a diagram showing an example in which the image processing program in the present embodiment is applied to a sample image. More specifically, FIG. 5A is a diagram showing a sample image. FIG. 5B is a diagram illustrating a processing result obtained by extracting a designated color region. Here, the “designated color” refers to the color of the corrected target area to be extracted. FIG. 5C is a diagram illustrating a processing result of extracting the seed region.
  • FIG. 5D is a diagram illustrating a result of performing the extension process.
  • FIG. 5E is a diagram illustrating a result of performing a filling process described later.
  • FIG. 5A is a diagram showing a sample image.
  • FIG. 5B is a diagram illustrating a processing result obtained by extracting a designated color region.
  • the “designated color” refers to the color of the corrected target area to be extracted.
  • FIG. 5C is a diagram illustrating a processing result of extracting the seed region.
  • FIG. 5D is a
  • FIG. 5A a woman wearing a hat is depicted on the right side of the image, and a flower is depicted on the left side of the image.
  • the sample image in FIG. 5A is actually a color image.
  • 5B to 5E are, for example, binary images on display, but are handled as color images, for example, in various calculations related to these images.
  • the following description will be made assuming that the face is extracted as the corrected target area from the sample image shown in FIG. 5A by the image processing program, but the present invention is not limited to this.
  • This image processing program is applicable not only to the extraction of a region with a small pixel change (for example, skin other than the face, blue sky, or sea). This also applies to second and third embodiments described later.
  • the “face” in the description relating to the sample image refers to a portion made up of a female face and neck in the sample image.
  • the area acquired (extracted) in each step may be referred to as a “white area”.
  • An area that has not been extracted may be referred to as a “black area”.
  • a specified color for example, a skin color region is extracted from the sample image.
  • a condition for specifying a specified color skin color
  • a condition relating to a range of luminance Y, saturation r, and hue ⁇ (hereinafter referred to as “range specifying condition”). Is used).
  • range specifying condition the ranges of luminance Y, saturation r, and hue ⁇ are referred to as “luminance range”, “saturation range”, and “hue range”, respectively.
  • the range specifying condition is given by the following equation (2).
  • FIG. 6 is a diagram schematically showing a range satisfying the saturation range and hue range shown in Expression (2) in the C r Cb coordinates.
  • a portion surrounded by a thick line is a range that satisfies the saturation range and hue range shown in Expression (2).
  • the seed region extraction unit 10 determines that the range specifying condition is satisfied when all of the luminance range, saturation range, and hue range shown in Expression (2) are satisfied, and should extract a region that satisfies the range specifying condition Suppose that it is a skin color area.
  • the extraction result is shown in FIG. FIG. 5B shows that in step S1, a part of the face that should be extracted is not extracted. This is because there is a region that does not satisfy the range specifying condition even in the face. It can also be seen that a part of the hat and a part of the flower that should not be extracted are extracted. This is because not only the face but also a hat and a flower have regions that satisfy the range specifying condition.
  • This step S1 corresponds to, for example, the same processing as the conventional threshold area extraction.
  • a seed region is extracted from the white region (including not only the face but also part of the hat and part of the flower) extracted in step S1. More specifically, a region that satisfies the first predetermined condition regarding the area is extracted as a seed region from the white region extracted in step S1.
  • the “first predetermined condition relating to the area” in the present embodiment is a condition in which the area is the maximum among the white regions extracted in step S1. For this reason, a region having the maximum area is extracted as a seed region from the white regions extracted in step S1. The extraction result is shown in FIG.
  • the face area that is the area corresponding to the face has the largest area, so that the face area is extracted as the seed area.
  • the region having the maximum area is extracted as the seed region, but the present invention is not limited to this.
  • the seed region can be extracted based on the area and / or shape of the region.
  • a method for determining the region shape for example, a method for determining a region having a circularity of a predetermined value or more as a desired shape is known.
  • C is the circularity
  • S is the area of the determination target region
  • L is the perimeter of the region.
  • the extraction of the seed region in consideration of the shape in this way is particularly suitable for extracting a region having a specific shape such as a face.
  • the entire face area has not been completely extracted. For this reason, if a process such as face recognition is performed using an extraction result having such a lack, a malfunction may occur.
  • the white balance can be adjusted as in the system according to Patent Document 2, using the color of the seed region obtained in step S2 as the face color.
  • step S3 it is determined whether or not a predetermined condition is satisfied in an area around the seed area obtained in step S2, and an area determined to satisfy the condition is included in the pre-correction target area, and Determining whether or not the condition is satisfied in an area around the area newly included in the pre-correction target area and including the area determined to satisfy the condition in the pre-correction target area.
  • An area determined to satisfy and a seed area are acquired as a pre-correction target area.
  • step S3 not only the seed region but also the region determined to satisfy the predetermined condition is included in the target region. That is, processing as if the seed region is expanded is performed.
  • step S3 for including the area determined to satisfy the predetermined condition in the target area is referred to as an “expansion process”.
  • the result of this expansion process is shown in FIG. FIG. 5D shows that the face area can be extracted more accurately than the seed area obtained in step S2.
  • black areas corresponding to the inner periphery of the pre-correction target area and corresponding to the eyebrows, the face, the nose, the mouth, and the like are located. Details of step S3 will be described later.
  • step S4 the above-described corrected target area is extracted by performing a so-called hole filling process in which the black area in contact with the inner periphery of the white area (target area before correction) is replaced with the white area.
  • the hole filling process is a process of replacing, for example, a black area whose area is equal to or smaller than a predetermined value among black areas in contact with the inner periphery of the white area.
  • FIG. 5E shows that the entire face area has been extracted.
  • the expansion process is performed by determining whether or not a gradient specifying condition described later is satisfied, starting from each pixel in the seed region. More specifically, in the extension process, each pixel in the seed region is set as a target pixel (referred to as a central pixel in the determination of the gradient specifying condition performed in the extension process), and pixels around the target pixel are specified in the gradient. It is determined whether or not the condition is satisfied, and if the condition is satisfied, a process of including the determination target pixel in the pre-correction target area (hereinafter referred to as “first extension process”) and a first extension process are newly performed.
  • first extension process a process of including the determination target pixel in the pre-correction target area
  • second extension process Using a pixel included in the target region as a target pixel, determine whether or not pixels around the target pixel satisfy the gradient specifying condition, and if the condition is satisfied, include the target pixel in the pre-correction target region (Hereinafter referred to as “second extension process”).
  • FIG. 7 is a flowchart showing details of step S3 (extension processing) in FIG.
  • step S3 includes steps S31 to S34, S34a, S35, and S35a.
  • the horizontal direction of the image is referred to as “X direction”
  • the vertical direction is referred to as “Y direction”.
  • variables representing the positions of the coordinates in the X direction and the Y direction are x and y, respectively.
  • a flag is set for each pixel. The flag is 1 if the pixel belongs to the white area, and the flag is 0 if the pixel belongs to the black area.
  • the flag value of each pixel is represented by F, and in particular, the flag value of a pixel whose X coordinate is x and Y coordinate is y (hereinafter referred to as a pixel of coordinates (x, y)) is F ( x, y).
  • step S33 includes steps S331 to S335.
  • steps S332 to 334 correspond to the first extension process
  • steps S333 to S335 correspond to the second extension process.
  • 9 to 11 are diagrams for explaining an example of the extension process. 9 to 11, the rightward arrow indicates the X direction, and the downward arrow indicates the Y direction.
  • Each block in FIGS. 9 to 11 shows one pixel.
  • the hatched blocks also correspond to pixels that should be extracted as face regions but are not extracted as seed regions but are black region pixels (hereinafter referred to as “probable seed region pixels”).
  • 1 is attached to the seed region pixel in FIG.
  • 0 should be attached to the black region pixel, it is omitted here for convenience.
  • FIG. 9 is indicated by a broken line, and a range to be expanded (described later) is indicated by a thick line. Note that the description regarding FIG. 10 is the same with respect to FIG. 11 except for the pixel at the coordinates (12, 7) and (11, 8).
  • the extension processing target can be four neighboring neighboring pixels of the pixel of interest, or eight neighboring neighboring pixels of the pixel of interest as shown in FIG. can do. Note that in FIG. 12A and FIG.
  • the extension processing target is four neighboring adjacent pixels of the target pixel.
  • the same description holds when the extension processing target is eight neighboring neighboring pixels of the target pixel.
  • the pixel at the coordinate (12, 8) is the target pixel, and the coordinates (12, 7), (11, 8), (13, 8), and (12) that are the four neighboring pixels.
  • 9) is an extension processing target.
  • step S333 the gradient of luminance Y, saturation r, and hue ⁇ between adjacent pixels will be described.
  • the gradients of luminance Y, saturation r, and hue ⁇ are referred to as “luminance gradient”, “saturation gradient”, and “hue gradient”, respectively, and are denoted by Y ′, r ′, ⁇ ′, respectively.
  • a Roberts filter, a pre-witt filter, or a Sobel filter can be used.
  • FIG. 13A is a diagram illustrating a 45-degree Roberts filter.
  • FIG. 13B is a diagram illustrating a 135 degree direction Roberts filter.
  • FIG. 13C is a diagram showing a pre-wit filter in the horizontal direction.
  • FIG. 13D is a diagram illustrating a pre-wit filter in the vertical direction.
  • FIG. 13E shows a horizontal Sobel filter.
  • FIG. 13F is a diagram illustrating a vertical Sobel filter. Although the filter size is 3 ⁇ 3 here, the present invention is not limited to this.
  • the luminance gradient Y ′, the saturation gradient r ′, and the hue gradient ⁇ ′ are calculated by the following equation (4).
  • Y h ′ is a luminance gradient in the first direction (45 ° direction or horizontal direction), and is calculated by the filter shown in FIG. 13A when the Roberts filter is used, and when the pre-wit filter is used.
  • Y v ′ is a luminance gradient in the second direction (135 ° direction or vertical direction), and is calculated by the filter shown in FIG. 13B when the Roberts filter is used, and when the pre-wit filter is used.
  • Y a ′, r a ′, and ⁇ a ′ are respectively the threshold value of the luminance gradient Y ′, the threshold value of the saturation gradient r ′, and the hue gradient ⁇ ′ for specifying pixels having relatively gentle gradients. It is a threshold value. These threshold values correspond to the first threshold value.
  • the luminance gradient Y ' is the threshold Y a' smaller than the saturation gradient r 'is the threshold r a' smaller than that when the color gradient theta 'threshold theta a' smaller than the extended
  • the pixels of coordinates (12, 7) and (11, 8) satisfy the gradient specifying condition shown in equation (5).
  • step S333 the second extension process is stopped.
  • step S34 such processing in step S33 is performed over the entire image.
  • the expansion process is performed based on a seed region that is a region that satisfies a predetermined specified color specifying condition.
  • the target area to be extracted originally lacks.
  • the expected seed region pixel is included in the target region by the expansion process. For this reason, it is possible to extract almost the entire target region without missing the target region to be extracted. Accordingly, various image processing such as face recognition or face color correction can be appropriately performed using the extracted target region.
  • high-cost recognition technology such as SVM (Support Vector Machine) is not used, the cost can be reduced.
  • the omission of the target region to be extracted can be more sufficiently suppressed by performing the hole filling process.
  • the range specifying condition is used as the specified color specifying condition in step S1, but a gradient specifying condition may be further used. That is, the specified color specifying condition may be satisfied when both the range specifying condition and the gradient specifying condition are satisfied.
  • the former is referred to as “extraction range specifying condition” and the latter is referred to as “extended use specifying condition”. This is called “range identification condition”.
  • the expansion range specifying condition is given by the equation (5) as described above.
  • the extraction range specifying condition is given by the following equation (6).
  • Y b ′, r b ′, and ⁇ b ′ are respectively a luminance gradient Y ′ threshold, a saturation gradient r ′ threshold, and a hue gradient ⁇ ′ for specifying a relatively gentle pixel. It is a threshold value. These threshold values correspond to the second threshold value.
  • the relationship between the threshold value related to the extraction range specifying condition and the threshold value related to the expansion range specifying condition is given by the following equation (7). As can be seen from Expression (7), the extraction range specifying condition is set more strictly than the extended range specifying condition.
  • FIG. 14 is a flowchart of an image processing program according to the second embodiment of the present invention. As shown in FIG. 14, step S2 in the first embodiment is replaced with step S2a, and step S5 is further added. Since the configuration of the image processing apparatus is the same as that of the first embodiment, description thereof is omitted. Also, with regard to the extraction process, description of parts common to the first embodiment will be omitted as appropriate.
  • Step S2a corresponds to the seed region extraction unit 10 as in step S2 in the first embodiment.
  • Step S5 corresponds to the area expansion unit 20, for example.
  • FIG. 15 is a diagram illustrating an example in which the image processing program in the present embodiment is applied to a sample image. More specifically, FIG.
  • FIG. 15A shows a sample image.
  • FIG. 15B is a diagram illustrating a processing result of extracting a specified color area.
  • FIG. 15C is a diagram illustrating a processing result of extracting the seed region.
  • FIG. 15D is a diagram illustrating a result of performing the extension process.
  • FIG. 15E is a diagram illustrating a result of the hole filling process.
  • the sample image is the same as that in the first embodiment, that is, FIG. 15A is the same as FIG. 5A. 15B and 15E are the same as FIGS. 5B and 5E, respectively.
  • step S2a a region that satisfies the first predetermined condition regarding the area is extracted as a seed region from the white region extracted in step S1.
  • the “first predetermined condition regarding the area” in the present embodiment is a condition in which the area is equal to or larger than a predetermined value in the white region extracted in step S1. It is. For this reason, a region having an area equal to or larger than a predetermined value is extracted as a seed region from the white regions extracted in step S1. The extraction result is shown in FIG.
  • a region having an area equal to or larger than a predetermined value is a face region (however, part thereof is missing) and a hat region (however, part thereof is missing) corresponding to the hat. ).
  • a plurality of seed regions can be extracted according to the setting of the area value of the region to be extracted.
  • step S3 processing similar to that in the first embodiment is performed based on the various areas obtained in step S2a.
  • the processing result is shown in FIG. From FIG. 15D, the hat region can be extracted more accurately than the seed region obtained in step S2 together with the face region similar to that in the first embodiment.
  • a region to be selected as a pre-correction target region is selected from the white regions extracted in step S3.
  • the “second predetermined condition relating to the area” in the present embodiment is a condition in which the area is the maximum among the white regions extracted in step S3. For this reason, the face area is a target area before correction, and the hat area, which is an unnecessary area, is excluded from the target area before correction.
  • the pre-correction target region may be selected based on the area and / or shape of the region, and the circularity may be used as described above. In particular, the selection of the pre-correction target area using the circularity is suitable for extracting a plurality of faces and the like.
  • step S4 the same as the first embodiment, the filling process is performed on the pre-correction target area obtained in step S5, and the post-correction target area is obtained.
  • FIG. FIG. 15E shows that the same result as in the first embodiment can be obtained.
  • the image processing program according to the present embodiment is applied to an image in which a plurality of faces are depicted instead of the sample image shown in FIG.
  • a plurality of seed regions can be extracted, and a plurality of pre-correction target regions can be extracted.
  • a plurality of faces can be extracted from an image in which a plurality of faces are depicted. That is, this embodiment is suitable for an aspect in which there are a plurality of target regions to be extracted.
  • FIG. 16 is a block diagram illustrating a functional configuration of a main part of an image processing apparatus according to the third embodiment of the present invention.
  • this image processing apparatus is obtained by adding an RGB-YC b Cr conversion unit 40 to the image processing apparatus according to the first embodiment.
  • the RGB-YC b Cr conversion unit 40 is realized by the CPU 1 as software. Since other configurations and operations are the same as those in the first embodiment, description thereof is omitted.
  • the image processing apparatus according to the present embodiment extracts a target area from an image indicated by image data received from a multimedia system. Therefore, unlike the first embodiment, in this embodiment, the input image data ID is composed of R data, B data, and G data as primary color signals.
  • the signal conversion in the RGB-YC b Cr converter 40 is performed based on the following equation (8).
  • the operations of the seed region extraction unit 10, the region expansion unit 20, and the correction unit 30 are the same as those in the first embodiment.
  • the modification of the first embodiment may be combined with the second embodiment or the third embodiment.
  • the third embodiment may be combined with the second embodiment.
  • the seed region extraction unit 10, the region expansion unit 20, the correction unit 30, and the RGB-YC b Cr conversion unit 40 are realized by software. May be realized by hardware.
  • R data, B data, and G data luminance data Y, first color difference data C b, and after converting the second color difference data C r, the saturation r and hue ⁇
  • luminance Y, saturation r, and hue ⁇ may be obtained directly from R data, B data, and G data.
  • the above-described embodiments can be variously modified and implemented without departing from the spirit of the present invention.
  • an image processing apparatus an image processing method, an image processing program, and a recording medium storing the image processing program that can extract an area with small pixel change from an image at low cost.
  • the present invention can be applied to an image processing apparatus, an image processing method, an image processing program, and a recording medium storing an image processing program that extract a region of a specific part of an object represented by the input image from the input image.

Abstract

Provided is an image processing device capable of extracting an area of minimal pixel change from an image, at low cost. The image processing device is provided with a seed region extraction section (10), a region expansion section (20), and a correction section (30). The seed region extraction section (10) extracts, as a seed region, a region that meets range-specifying conditions which are predetermined conditions relating to input image data (ID) luminance (Y), and saturation (r) and hue (θ) obtained from first color difference data (Cb) and second color difference data (Cr). Selecting a pixel of the seed region as the origin, the region expansion section (20) assesses whether the surrounding pixels meet gradient-specifying conditions which are conditions relating to luminance gradient (Y'), saturation gradient (r'), and hue gradient (θ'), and if the conditions are met, the pixel so assessed is included in a pre-correction target region. The correction section (30) performs a hole filling process on the pre-correction target region to acquire a post-correction target region.

Description

画像処理装置、画像処理方法、画像処理プログラム、および画像処理プログラムを記憶した記録媒体Image processing apparatus, image processing method, image processing program, and recording medium storing image processing program
 本発明は、入力画像から、当該入力画像によって表現される対象物の特定部分の領域を抽出する画像処理装置に関し、より詳しくは、画素間の変化が小さい領域の抽出に好適な画像処理装置、画像処理方法、画像処理プログラム、および画像処理プログラムを記憶した記録媒体に関する。 The present invention relates to an image processing device that extracts a region of a specific part of an object represented by an input image from an input image, and more specifically, an image processing device suitable for extracting a region with a small change between pixels, The present invention relates to an image processing method, an image processing program, and a recording medium storing the image processing program.
 画像によって表現される対象物の特定部分を用いて画像処理を行う場合などでは、画像から当該特定部分の領域を抽出する必要がある。そこで従来から、画像中の特定の領域を抽出する技術が用いられている。例えば皮膚(顔など)、青空、または海などの画素間の変化が小さい領域(以下「画素変化の小さい領域」という。)の抽出は、画像中の各画素が輝度、彩度、および色相に関する所定の閾値条件を満たすか否かを判定することなどにより行われる。以下では、このような閾値条件を用いた領域抽出のことを「閾値領域抽出」という。 When performing image processing using a specific part of an object represented by an image, it is necessary to extract the region of the specific part from the image. Therefore, conventionally, a technique for extracting a specific region in an image has been used. For example, extraction of an area where changes between pixels such as skin (face, etc.), blue sky, or sea are small (hereinafter referred to as “area with small pixel changes”) is related to brightness, saturation, and hue of each pixel in the image. This is performed by determining whether or not a predetermined threshold condition is satisfied. Hereinafter, region extraction using such a threshold condition is referred to as “threshold region extraction”.
 本願発明に関連して、特許文献1には、皮膚模様の画像中の関心のある領域を決定する方法が開示されている。ここで、関心のある領域とは、例えば指紋を含む領域を指す。本方法では、画像中の第1の値の範囲(暗い範囲)内の値は隆線に割り当てられ、第2の値の範囲(明るい範囲)内の値は谷間に割り当てられ、その後、画像全体の値は第1の値の範囲の方向にシフトされる。そして、画像全体がタイルに分割された後、個々のタイルについてのシフトとの値の平均値が基準値と比較される。平均値が基準値に対して第1の方向にずれているタイルは関心のある領域とみなされる。 In connection with the present invention, Patent Document 1 discloses a method for determining a region of interest in a skin pattern image. Here, the region of interest refers to a region including, for example, a fingerprint. In this method, values in the first value range (dark range) in the image are assigned to ridges, values in the second value range (light range) are assigned to valleys, and then the entire image Is shifted in the direction of the first value range. Then, after the entire image is divided into tiles, the average value of the shift values for the individual tiles is compared with the reference value. A tile whose average value is shifted in the first direction with respect to the reference value is regarded as a region of interest.
 また、特許文献2には、顔色を基準信号として用いて画像のホワイトバランスを調整するシステムが開示されている。すなわち、本システムは、顔検出器により顔を検出し、当該顔から肌色を抽出する。そして、当該肌色をホワイトバランスの調整に用いる。 Further, Patent Document 2 discloses a system that adjusts the white balance of an image using the face color as a reference signal. That is, this system detects a face with a face detector and extracts skin color from the face. Then, the skin color is used for white balance adjustment.
日本の特表2006-507582号公報Japanese Special Table 2006-507582 日本の特表2005-531189号公報Japanese Special Table 2005-531189
 しかし、特許文献1に記載の方法では、指紋などの紋様がない領域、すなわち画素変化の小さい領域の抽出を行うことは困難である。また、特許文献2に記載のシステムでは、輝度ベースの顔検出アルゴリズムが用いられる。例えば、SVM(Support Vector Machine)などの認識技術を用いれば顔全体の抽出が可能であるが、高コストとなり、またこの場合には、青空または海などの顔以外の画素変化の小さい領域は抽出対象にならない。一方、比較的安価なコストの認識技術を用いた場合には、顔などの抽出すべき対象領域の一部が欠落して抽出されるおそれがある。このような欠落は、抽出した対象領域を用いて所定の画像処理(例えば顔認識または顔色補正など)を行う場合に、誤動作を生じさせる要因となり得る。 However, in the method described in Patent Document 1, it is difficult to extract an area where there is no pattern such as a fingerprint, that is, an area where the pixel change is small. In the system described in Patent Document 2, a luminance-based face detection algorithm is used. For example, if a recognition technique such as SVM (Support Vector Vector Machine) is used, the entire face can be extracted. However, the cost is high, and in this case, an area with a small pixel change other than the face such as a blue sky or the sea is extracted. Not eligible. On the other hand, when a relatively inexpensive cost recognition technique is used, a part of the target area to be extracted such as a face may be missing and extracted. Such omission can be a cause of malfunction when performing predetermined image processing (for example, face recognition or face color correction) using the extracted target region.
 そこで、本発明は、画像から画素変化の小さい領域を低コストで抽出可能な画像処理装置、画像処理方法、画像処理プログラム、および画像処理プログラムを記憶した記録媒体を提供することを目的とする。 Therefore, an object of the present invention is to provide an image processing apparatus, an image processing method, an image processing program, and a recording medium storing the image processing program, which can extract an area with a small pixel change from an image at low cost.
 本発明の第1の局面は、入力画像から対象領域を抽出する画像処理装置であって、
 前記入力画像の中から、予め定められた輝度、彩度、および色相の範囲に関する条件を少なくとも満たす領域を種領域として抽出する種領域抽出部と、
 前記種領域の周辺の領域における輝度、彩度、および色相の勾配がそれぞれ輝度、彩度、および色相に関する第1閾値以下であるか否かを判定して前記勾配が前記第1閾値以下であると判定された領域を前記対象領域に含め、かつ、前記対象領域に新たに含められた領域の周辺の領域における前記勾配が前記第1閾値以下であるか否かを判定して前記勾配が前記第1閾値以下であると判定された領域を含めることにより、前記勾配が前記第1閾値以下であると判定された領域および前記種領域を前記対象領域として取得する領域拡張部とを備えることを特徴とする。
A first aspect of the present invention is an image processing apparatus that extracts a target region from an input image,
A seed region extraction unit that extracts, as a seed region, a region that satisfies at least conditions relating to a predetermined range of luminance, saturation, and hue from the input image;
It is determined whether or not the gradients of luminance, saturation, and hue in the peripheral region of the seed region are less than or equal to a first threshold for luminance, saturation, and hue, respectively, and the gradient is less than or equal to the first threshold. The region determined to be included in the target region and whether or not the gradient in the region around the region newly included in the target region is equal to or less than the first threshold value is determined. Including an area determined to be equal to or less than a first threshold, and an area expansion unit that acquires the area where the gradient is equal to or less than the first threshold and the seed area as the target area. Features.
 本発明の第2の局面は、本発明の第1の局面において、
 前記領域拡張部は、前記勾配が第1閾値以下であるか否かの判定を、前記種領域中の各画素を起点として行うことを特徴とする。
According to a second aspect of the present invention, in the first aspect of the present invention,
The region expanding unit may determine whether or not the gradient is equal to or less than a first threshold, using each pixel in the seed region as a starting point.
 本発明の第3の局面は、本発明の第2の局面において、
 前記領域拡張部は、
  前記種領域中の各画素を注目画素として、当該画素の周辺の画素における前記勾配が前記第1閾値以下である否かを判定し、判定結果が前記第1閾値以下であれば判定対象の画素を前記対象領域に含める第1の拡張処理と、
  新たに前記対象領域に含められた画素を注目画素として、当該画素の周辺の画素における前記勾配が前記第1閾値以下である否かを判定し、判定結果が前記第1閾値以下であれば判定対象の画素を前記対象領域に含めることを繰り返す第2の拡張処理とを行う特徴とする。
According to a third aspect of the present invention, in the second aspect of the present invention,
The area extension is
Using each pixel in the seed region as a pixel of interest, it is determined whether or not the gradient in the surrounding pixels of the pixel is equal to or less than the first threshold value. If the determination result is equal to or less than the first threshold value, the pixel to be determined A first expansion process for including
A pixel newly included in the target region is set as a pixel of interest, and it is determined whether or not the gradient of pixels around the pixel is equal to or less than the first threshold. If the determination result is equal to or less than the first threshold, the determination is made. And a second extension process for repeatedly including the target pixel in the target area.
 本発明の第4の局面は、本発明の第1の局面から第3の局面までのいずれかにおいて、
 前記種領域抽出部は、前記勾配が所定値以下である条件をさらに満たす領域を前記種領域して抽出することを特徴とする。
According to a fourth aspect of the present invention, in any one of the first to third aspects of the present invention,
The seed region extraction unit extracts a region that further satisfies a condition that the gradient is equal to or less than a predetermined value as the seed region.
 本発明の第5の局面は、本発明の第4の局面において、
 前記所定値は、前記第1閾値よりも小さい第2閾値であることを特徴とする。
According to a fifth aspect of the present invention, in the fourth aspect of the present invention,
The predetermined value is a second threshold value smaller than the first threshold value.
 本発明の第6の局面は、本発明の第1の局面から第3の局面までのいずれかにおいて、
 前記種領域抽出部は、前記輝度、彩度、および色相の範囲に関する条件を満たす領域が複数ある場合に、当該複数の領域のうちの、面積に関する第1の所定の条件を満たす領域を前記種領域として抽出することを特徴とする。
According to a sixth aspect of the present invention, in any one of the first to third aspects of the present invention,
When there are a plurality of regions that satisfy the conditions regarding the luminance, saturation, and hue ranges, the seed region extraction unit selects a region that satisfies a first predetermined condition regarding the area from the plurality of regions. It is characterized by extracting as a region.
 本発明の第7の局面は、本発明の第6の局面において、
 前記面積に関する第1の所定の条件は、前記輝度、彩度、および色相の範囲に関する条件を満たす複数の領域のうちで面積が最大であるという条件であることを特徴とする。
A seventh aspect of the present invention is the sixth aspect of the present invention,
The first predetermined condition relating to the area is a condition that the area is maximum among a plurality of regions that satisfy the conditions relating to the luminance, saturation, and hue ranges.
 本発明の第8の局面は、本発明の第6の局面において、
 前記面積に関する第1の所定の条件は、面積が所定値以上であるという条件であることを特徴とする。
According to an eighth aspect of the present invention, in the sixth aspect of the present invention,
The first predetermined condition regarding the area is a condition that the area is a predetermined value or more.
 本発明の第9の局面は、本発明の第8の局面において、
 前記領域拡張部は、前記勾配が前記第1閾値以下であると判定された領域および前記種領域からそれぞれがなる複数の領域が得られた場合に、当該複数の領域のうちの、面積に関する第2の所定の条件を満たす領域を抽出すべき対象領域とすることを特徴とする。
A ninth aspect of the present invention is the eighth aspect of the present invention,
When the region expansion unit obtains a plurality of regions each composed of the region determined to have the gradient equal to or less than the first threshold and the seed region, the region expansion unit A region satisfying the predetermined condition of 2 is set as a target region to be extracted.
 本発明の第10の局面は、本発明の第9の局面において、
 前記面積に関する第2の所定の条件は、前記複数の領域のうちで面積が最大であるという条件であることを特徴とする。
According to a tenth aspect of the present invention, in a ninth aspect of the present invention,
The second predetermined condition regarding the area is a condition that the area is the maximum among the plurality of regions.
 本発明の第11の局面は、本発明の第1の局面から第3の局面までのいずれかにおいて、
 前記領域拡張部が取得した前記対象領域に対して所定の補正処理を行う補正部をさらに備えることを特徴とする。
In an eleventh aspect of the present invention, in any one of the first to third aspects of the present invention,
The image processing apparatus further includes a correction unit that performs a predetermined correction process on the target area acquired by the area expansion unit.
 本発明の第12の局面は、本発明の第11の局面において、
 前記所定の補正処理は、前記領域拡張部が取得した前記対象領域の内周に接する当該対象領域ではない領域のうちの、面積が所定値以下の領域を当該対象領域に含める処理であることを特徴とする。
A twelfth aspect of the present invention is the eleventh aspect of the present invention,
The predetermined correction process is a process of including, in the target area, an area whose area is equal to or less than a predetermined value among the areas that are not the target area in contact with the inner periphery of the target area acquired by the area expanding unit. Features.
 本発明の第13の局面は、本発明の第1の局面から第3の局面までのいずれかにおいて、
 前記入力画像は、輝度信号および色差信号で示されることを特徴とする。
According to a thirteenth aspect of the present invention, in any one of the first to third aspects of the present invention,
The input image is indicated by a luminance signal and a color difference signal.
 本発明の第14の局面は、本発明の第13の局面において、
 原色信号で示される入力画像を、輝度信号および色差信号で示される前記入力画像に変換する信号形式変換部をさらに備えることを特徴とする。
A fourteenth aspect of the present invention is the thirteenth aspect of the present invention,
The image processing apparatus further includes a signal format conversion unit that converts an input image indicated by a primary color signal into the input image indicated by a luminance signal and a color difference signal.
 本発明の第15の局面は、入力画像から対象領域を抽出する画像処理方法であって、
 前記入力画像の中から、予め定められた輝度、彩度、および色相の範囲に関する条件を少なくとも満たす領域を種領域として抽出する種領域抽出ステップと、
 前記種領域の周辺の領域における輝度、彩度、および色相の勾配がそれぞれ輝度、彩度、および色相に関する第1閾値以下であるか否かを判定して前記勾配が前記第1閾値以下であると判定された領域を前記対象領域に含め、かつ、前記対象領域に新たに含められた領域の周辺の領域における前記勾配が前記第1閾値以下であるか否かを判定して前記勾配が前記第1閾値以下であると判定された領域を含めることにより、前記勾配が前記第1閾値以下であると判定された領域および前記種領域を前記対象領域として取得する領域拡張ステップとを備えることを特徴とする。
A fifteenth aspect of the present invention is an image processing method for extracting a target region from an input image,
A seed region extraction step for extracting, from the input image, a region that satisfies at least the conditions relating to the predetermined luminance, saturation, and hue range as a seed region;
It is determined whether or not the gradients of luminance, saturation, and hue in the peripheral region of the seed region are less than or equal to a first threshold for luminance, saturation, and hue, respectively, and the gradient is less than or equal to the first threshold. The region determined to be included in the target region and whether or not the gradient in the region around the region newly included in the target region is equal to or less than the first threshold value is determined. Including an area determined to be equal to or lower than a first threshold, and an area expansion step for acquiring the area determined to be equal to or lower than the first threshold and the seed area as the target area. Features.
 本発明の第16の局面は、本発明の第15の局面において、
 前記領域拡張ステップでは、前記勾配が第1閾値以下であるか否かの判定は、前記種領域中の各画素を起点として行われることを特徴とする。
A sixteenth aspect of the present invention is the fifteenth aspect of the present invention,
In the region expansion step, the determination as to whether or not the gradient is equal to or less than a first threshold value is performed starting from each pixel in the seed region.
 本発明の第17の局面は、本発明の第16の局面において、
 前記領域拡張ステップは、
  前記種領域中の各画素を注目画素として、当該画素の周辺の画素における前記勾配が前記第1閾値以下である否かを判定し、判定結果が前記第1閾値以下であれば判定対象の画素を前記対象領域に含める第1の拡張ステップと、
  新たに前記対象領域に含められた画素を注目画素として、当該画素の周辺の画素における前記勾配が前記第1閾値以下である否かを判定し、判定結果が前記第1閾値以下であれば判定対象の画素を前記対象領域に含めることを繰り返す第2の拡張ステップとを含むことを特徴とする。
A seventeenth aspect of the present invention is the sixteenth aspect of the present invention,
The region expansion step includes
Using each pixel in the seed region as a pixel of interest, it is determined whether or not the gradient in the surrounding pixels of the pixel is equal to or less than the first threshold value. If the determination result is equal to or less than the first threshold value, the pixel to be determined A first expansion step of including in the region of interest;
A pixel newly included in the target region is set as a pixel of interest, and it is determined whether or not the gradient of pixels around the pixel is equal to or less than the first threshold. If the determination result is equal to or less than the first threshold, the determination is made. And a second extension step of repeatedly including the target pixel in the target region.
 本発明の第18の局面は、画像処理プログラムであって、
 本発明の第15の局面から第17の局面までいずれかに係る画像処理方法における各ステップをコンピュータに実行させることを特徴とする。
An eighteenth aspect of the present invention is an image processing program,
A computer is caused to execute each step in the image processing method according to any one of the fifteenth to seventeenth aspects of the present invention.
 本発明の第19の局面は、コンピュータ読み取り可能な記録媒体であって、
 本発明の第18の局面に係る画像処理プログラムを記録したことを特徴とする。
A nineteenth aspect of the present invention is a computer-readable recording medium,
An image processing program according to an eighteenth aspect of the present invention is recorded.
 本発明の第1の局面または第15の局面によれば、予め定められた輝度、彩度、および色相の範囲に関する条件を少なくとも満たす種領域に基づいて、拡張処理(勾配が第1閾値以下であるか否かを判定し、これを満たす領域を対象領域に加える処理)が行われる。従来の閾値領域抽出では、この種領域が抽出すべき対象領域とされていたので、本来抽出すべき対象領域に欠落が生じていた。しかし、本発明の第1の局面または第15の局面では、上記拡張処理により、本来抽出されるべきであるが種領域としては抽出されなかった領域が対象領域に含まれる。このため、抽出すべき対象領域に欠落をさせず、その対象領域のほぼ全体を抽出できる。これにより、抽出した対象領域を用いて、顔認識または顔色補正などの種々の画像処理を適切に行うことができる。また、SVM(Support Vector Machine)などの高コストな認識技術を用いないので、低コスト化を図ることができる。 According to the first aspect or the fifteenth aspect of the present invention, an expansion process (with a gradient equal to or less than the first threshold value) is performed based on a seed region that satisfies at least conditions relating to predetermined luminance, saturation, and hue ranges. A process of determining whether or not there is and adding a region satisfying this to the target region) is performed. In the conventional threshold area extraction, since this kind of area is set as the target area to be extracted, the target area to be extracted originally lacks. However, in the first aspect or the fifteenth aspect of the present invention, the target area includes an area that should have been extracted by the expansion process but was not extracted as a seed area. For this reason, it is possible to extract almost the entire target region without missing the target region to be extracted. Accordingly, various image processing such as face recognition or face color correction can be appropriately performed using the extracted target region. Further, since high-cost recognition technology such as SVM (Support Vector Vector Machine) is not used, cost reduction can be achieved.
 本発明の第2の局面または第16の局面によれば、種領域中の各画素を起点として勾配に関する条件の判定を行うことにより、本発明の第1の局面または第15の局面と同様の効果を得ることができる。 According to the second aspect or the sixteenth aspect of the present invention, the conditions relating to the gradient are determined using each pixel in the seed region as a starting point, and thus the same as the first aspect or the fifteenth aspect of the present invention. An effect can be obtained.
 本発明の第3の局面または第17の局面によれば、第1の拡張処理(第1の拡張ステップ)および第2の拡張処理(第2の拡張ステップ)を行うことにより、本発明の第2の局面または第16の局面と同様の効果を得ることができる。 According to the third aspect or the seventeenth aspect of the present invention, by performing the first expansion process (first expansion step) and the second expansion process (second expansion step), Effects similar to those of the second aspect or the sixteenth aspect can be obtained.
 本発明の第4の局面によれば、種領域の抽出処理において、輝度、彩度、および色相の勾配が所定値以下である条件が加わる。このため、勾配の大きい領域、すなわち、顔などの画素変化の小さい領域以外の領域を種領域から除外できる。このため、対象領域の抽出精度を高めることができる。 According to the fourth aspect of the present invention, in the seed region extraction process, a condition is added in which the brightness, saturation, and hue gradient are equal to or less than predetermined values. For this reason, a region having a large gradient, that is, a region other than a region having a small pixel change such as a face can be excluded from the seed region. For this reason, the extraction accuracy of the target region can be increased.
 本発明の第5の局面によれば、拡張処理における輝度、彩度、および色相の勾配の条件よりも、種領域の抽出処理における輝度、彩度、および色相の勾配の条件の方が厳しく設定される。このため、顔などの画素変化の小さい領域以外の領域を、種領域からより確実に除外できる。これにより、より正確な(すなわちノイズの少ない)種領域を拡張処理において用いることができるので、対象領域の抽出精度をより高めることができる。 According to the fifth aspect of the present invention, the conditions of the brightness, saturation, and hue gradient in the seed region extraction process are set more strictly than the conditions of the brightness, saturation, and hue gradient in the expansion process. Is done. For this reason, regions other than regions with small pixel changes, such as faces, can be more reliably excluded from the seed region. As a result, a more accurate seed region (that is, with less noise) can be used in the expansion process, and thus the extraction accuracy of the target region can be further increased.
 本発明の第6の局面によれば、面積に関する第1の所定の条件を満たす領域を種領域として抽出することにより、本発明の第1の局面から第3の局面までのいずれかと同様の効果を得ることができる。 According to the sixth aspect of the present invention, the same effect as any of the first to third aspects of the present invention is obtained by extracting a region that satisfies the first predetermined condition regarding the area as a seed region. Can be obtained.
 本発明の第7の局面によれば、輝度、彩度、および色相の範囲の条件を満たす複数の領域のうちで面積が最大であるという条件を面積に関する第1の所定の条件とすることにより、本発明の第6の局面と同様の効果を得ることができる。 According to the seventh aspect of the present invention, the condition that the area is the maximum among the plurality of regions that satisfy the conditions of the luminance, saturation, and hue ranges is set as the first predetermined condition relating to the area. The same effect as that of the sixth aspect of the present invention can be obtained.
 本発明の第8の局面によれば、面積が所定値以上であるという条件を面積に関する第1の所定の条件とすることにより、本発明の第6の局面と同様の効果を得ることができる。また、複数の種領域が抽出可能となる。このため、例えば複数の顔が描写された画像などから複数の顔を抽出できる。 According to the eighth aspect of the present invention, the same effect as that of the sixth aspect of the present invention can be obtained by setting the condition that the area is equal to or greater than a predetermined value as the first predetermined condition relating to the area. . In addition, a plurality of seed regions can be extracted. For this reason, for example, a plurality of faces can be extracted from an image in which a plurality of faces are depicted.
 本発明の第9の局面によれば、面積に関する第2の所定の条件を満たす対象領域を抽出すべき対象領域とすることにより、不要な対象領域を除外することができる。 According to the ninth aspect of the present invention, an unnecessary target region can be excluded by setting a target region to be extracted as a target region that satisfies the second predetermined condition regarding the area.
 本発明の第10の局面によれば、複数の対象領域のうちで面積が最大であるという条件を面積に関する第2の所定の条件とすることにより、本発明の第9の局面と同様の効果を得ることができる。 According to the tenth aspect of the present invention, the same effect as that of the ninth aspect of the present invention is obtained by setting the condition that the area is the largest among the plurality of target regions as the second predetermined condition regarding the area. Can be obtained.
 本発明の第11の局面によれば、補正処理により、例えば抽出すべき対象領域の欠落をより抑制することができる。 According to the eleventh aspect of the present invention, for example, the omission of the target region to be extracted can be further suppressed by the correction process.
 本発明の第12の局面によれば、領域拡張部が取得した対象領域の内周に接する当該対象領域ではない領域のうちの、面積が所定値以下の領域を当該対象領域に含める処理が行われる。このため、抽出すべき対象領域の欠落をより十分に抑制することができる。 According to the twelfth aspect of the present invention, the process of including, in the target region, a region whose area is equal to or less than a predetermined value among the regions that are not the target region that are in contact with the inner periphery of the target region acquired by the region expanding unit. Is called. For this reason, the omission of the target region to be extracted can be more sufficiently suppressed.
 本発明の第13の局面によれば、例えばテレビ放送を受信して得られるか、またはビデオシステムから得られる画像データが示す画像から対象領域を抽出する場合において、本発明の第1の局面または第3の局面と同様の効果を得ることができる。 According to the thirteenth aspect of the present invention, in the case of extracting a target area from an image indicated by image data obtained by receiving a television broadcast or obtained from a video system, for example, The same effect as the third aspect can be obtained.
 本発明の第14の局面によれば、例えばマルチメディアシステムから受信する画像データが示す画像から対象領域を抽出する場合において、本発明の第1の局面または第3の局面と同様の効果を得ることができる。 According to the fourteenth aspect of the present invention, for example, when the target area is extracted from the image indicated by the image data received from the multimedia system, the same effect as that of the first aspect or the third aspect of the present invention is obtained. be able to.
 本発明の第18の局面によれば、画像処理プログラムにおいて、本発明の第15の局面から第17の局面までのいずれかと同様の効果を得ることができる。 According to the eighteenth aspect of the present invention, in the image processing program, the same effect as any of the fifteenth aspect to the seventeenth aspect of the present invention can be obtained.
 本発明の第19の局面によれば、コンピュータ読み取り可能な記録媒体において、本発明の第15の局面から第17の局面までのいずれかと同様の効果を得ることができる。 According to the nineteenth aspect of the present invention, in a computer-readable recording medium, the same effect as any of the fifteenth to seventeenth aspects of the present invention can be obtained.
本発明の第1の実施形態に係る画像処理装置のハードウェア構成を示すブロック図である。It is a block diagram which shows the hardware constitutions of the image processing apparatus which concerns on the 1st Embodiment of this invention. 上記第1の実施形態に係る画像処理装置の要部の機能的構成を示すブロック図である。It is a block diagram which shows the functional structure of the principal part of the image processing apparatus which concerns on the said 1st Embodiment. rb座標での各色の位置関係を模式的に示す図である。It is a diagram schematically showing the positional relationship of the respective colors in C r C b coordinates. 上記第1の実施形態における画像処理プログラムのフローチャートである。It is a flowchart of the image processing program in the said 1st Embodiment. 上記第1の実施形態における画像処理プログラムを見本画像に対して適用した例を示す図である。(A)は、見本画像を示す図である。(B)は、指定色の領域を抽出した処理結果を示す図である。(C)は、種領域を抽出した処理結果を示す図である。(D)は、拡張処理を行った結果を示す図である。(E)は、穴埋め処理を行った結果を示す図である。It is a figure which shows the example which applied the image processing program in the said 1st Embodiment with respect to the sample image. (A) is a figure which shows a sample image. (B) is a diagram showing a processing result of extracting a designated color region. (C) is a figure which shows the processing result which extracted the seed area | region. (D) is a figure which shows the result of having performed the expansion process. (E) is a figure which shows the result of having performed the hole-filling process. rb座標において、肌色に関する彩度および色相の範囲を模式的に示す図である。In C r C b coordinate a diagram schematically showing a range of saturation and hue related skin tone. 図4におけるステップS3の詳細を示すフローチャートである。It is a flowchart which shows the detail of step S3 in FIG. 図7におけるステップS33の詳細を示すフローチャートである。It is a flowchart which shows the detail of step S33 in FIG. 上記第1の実施形態における拡張処理の例を説明するための図である。It is a figure for demonstrating the example of the expansion process in the said 1st Embodiment. 上記第1の実施形態における拡張処理の例を説明するための図である。It is a figure for demonstrating the example of the expansion process in the said 1st Embodiment. 上記第1の実施形態における拡張処理の例を説明するための図である。It is a figure for demonstrating the example of the expansion process in the said 1st Embodiment. 上記第1の実施形態における拡張処理対象について説明するための模式図である。(A)は、4近傍隣接画素を拡張処理対象とする場合の模式図である。(B)は、8近傍隣接画素を拡張処理対象とする場合の模式図である。It is a schematic diagram for demonstrating the expansion process object in the said 1st Embodiment. (A) is a schematic diagram when four adjacent pixels are subject to expansion processing. (B) is a schematic diagram in the case where 8 neighboring pixels are subject to expansion processing. 上記第1の実施形態における勾配の算出に用いられるフィルタを示す図である。(A)は、45度方向のロバーツフィルタを示す図である。(B)は、135度方向のロバーツフィルタを示す図である。(C)は、水平方向のプレウィットフィルタを示す図である。(D)は、垂直方向のプレウィットフィルタを示す図である。(E)は、水平方向のソーベルフィルタを示す図である。(F)は、垂直方向のソーベルフィルタを示す図である。It is a figure which shows the filter used for calculation of the gradient in the said 1st Embodiment. (A) is a figure which shows the Roberts filter of a 45 degree direction. (B) is a figure which shows the Roberts filter of a 135 degree direction. (C) is a figure which shows the pre-wit filter of a horizontal direction. (D) is a diagram showing a pre-wit filter in the vertical direction. (E) is a figure which shows the Sobel filter of a horizontal direction. (F) is a figure which shows the Sobel filter of a perpendicular direction. 本発明の第2の実施形態における画像処理プログラムのフローチャートである。It is a flowchart of the image processing program in the 2nd Embodiment of this invention. 上記第2の実施形態における画像処理プログラムを見本画像に対して適用した例を示す図である。(A)は、見本画像を示す図である。(B)は、指定色の領域を抽出した処理結果を示す図である。(C)は、種領域を抽出した処理結果を示す図である。(D)は、拡張処理を行った結果を示す図である。(E)は、穴埋め処理を行った結果を示す図である。It is a figure which shows the example which applied the image processing program in the said 2nd Embodiment with respect to the sample image. (A) is a figure which shows a sample image. (B) is a diagram showing a processing result of extracting a designated color region. (C) is a figure which shows the processing result which extracted the seed area | region. (D) is a figure which shows the result of having performed the expansion process. (E) is a figure which shows the result of having performed the hole-filling process. 本発明の第3の実施形態に係る画像処理装置の要部の機能的構成を示すブロック図である。It is a block diagram which shows the functional structure of the principal part of the image processing apparatus which concerns on the 3rd Embodiment of this invention.
 以下、添付図面を参照しながら、本発明の第1~第3の実施形態について説明する。 Hereinafter, first to third embodiments of the present invention will be described with reference to the accompanying drawings.
 <1.第1の実施形態>
 <1.1 構成および処理概要>
 図1は、本実施形態に係る画像処理装置のハードウェア構成を示すブロック図である。図1に示すように、本画像処理装置は、CPU1、入力部2、メモリ3、ハードディスク装置4、および出力部5を備えている。ハードディスク装置4には、本実施形態におけるエッジ強調処理をCPU1に実行させるための画像処理プログラム6が格納されている。画像処理プログラム6は例えば、当該画像処理プログラム6を記憶したDVD-ROMなどの記録媒体から図示しないDVDドライブなどにより読み取られ、インストールされたものでも良く、また、図示しないネットワークを介して供給され、インストールされたものでも良い。
<1. First Embodiment>
<1.1 Configuration and processing overview>
FIG. 1 is a block diagram illustrating a hardware configuration of the image processing apparatus according to the present embodiment. As shown in FIG. 1, the image processing apparatus includes a CPU 1, an input unit 2, a memory 3, a hard disk device 4, and an output unit 5. The hard disk device 4 stores an image processing program 6 for causing the CPU 1 to execute the edge enhancement processing according to the present embodiment. For example, the image processing program 6 may be read and installed by a DVD drive or the like (not shown) from a recording medium such as a DVD-ROM storing the image processing program 6, or supplied via a network (not shown) It can be installed.
 本画像処理装置には、入力部2を介して、入力画像信号に含まれる入力画像データIDが外部から入力される。入力画像データIDは入力画像を示す。メモリ3には、入力画像データID、ハードディスク装置4から読み出された画像処理プログラム6が一時的に格納され、CPU1は、これらの入力画像データIDおよび画像処理プログラム6に基づいて、入力画像から抽出した、当該入力画像によって表現される対象物の特定部分(本実施形態では例えば顔である。)の領域である対象領域を示す抽出データEDを生成する。生成された抽出データEDは、出力部5を介して外部に出力される。 The input image data ID included in the input image signal is input to the image processing apparatus from the outside via the input unit 2. The input image data ID indicates an input image. The memory 3 temporarily stores the input image data ID and the image processing program 6 read from the hard disk device 4. The CPU 1 stores the input image data ID and the image processing program 6 based on the input image data ID and the image processing program 6. Extracted data ED indicating a target region that is a region of a specific portion (for example, a face in the present embodiment) of the target object expressed by the input image is generated. The generated extracted data ED is output to the outside via the output unit 5.
 図2は、本実施形態に係る画像処理装置の要部の機能的構成を示すブロック図である。図2に示すように、本画像処理装置は、種領域抽出部10、領域拡張部20、および補正部30を備えている。本画像処理装置は、テレビ放送を受信して得られるか、またはビデオシステムから得られる画像データが示す画像から対象領域を抽出するものである。したがって、本実施形態における入力画像データIDは、輝度信号としての輝度データ(以下単に「輝度」ともいう。)Y、第1色差信号として第1色差データCb、および第2色差信号として第2色差データCrからなっている。ここで、第1色差データCbは入力画像中の青色成分と輝度データYとの差分を表す色差データである。また、第2色差データCrは入力画像中の赤色成分と輝度データYとの差分を表す色差データである。入力画像データIDは、種領域抽出部10および領域拡張部20に与えられる。 FIG. 2 is a block diagram illustrating a functional configuration of a main part of the image processing apparatus according to the present embodiment. As shown in FIG. 2, the image processing apparatus includes a seed region extraction unit 10, a region expansion unit 20, and a correction unit 30. This image processing apparatus extracts a target region from an image indicated by image data obtained by receiving a television broadcast or obtained from a video system. Therefore, the input image data ID in the present embodiment is luminance data (hereinafter also simply referred to as “luminance”) Y as a luminance signal, first color difference data C b as a first color difference signal, and second as a second color difference signal. It consists of color difference data Cr . Here, the first color difference data Cb is color difference data representing a difference between the blue component in the input image and the luminance data Y. The second color difference data C r is the color difference data representing the difference between the red component and the luminance data Y in the input image. The input image data ID is given to the seed region extraction unit 10 and the region expansion unit 20.
 種領域抽出部10は、受け取った入力画像データIDのうちの第1色差データCbおよび第2色差データCrから、次式(1)により彩度rおよび色相θを求める。
Figure JPOXMLDOC01-appb-M000001
Seed region extraction unit 10, from the first color difference data C b and the second color difference data C r of the input image data ID received, obtains the saturation r and hue θ by the following equation (1).
Figure JPOXMLDOC01-appb-M000001
 図3は、Crb座標での各色の位置関係を模式的に示す図である。ここで示す各色の位置関係は、ITU-R BT.709規格に基づいて算出されるものである。図3に示すように、例えばθ=50°はマゼンタ(M)対応し、θ=103°は赤(R)に対応し、θ=175°は黄(Ye)に対応し、θ=230°は緑(G)に対応し、θ=283°はシアン(C)に対応し、θ=355°は青(B)に対応する。 FIG. 3 is a diagram schematically showing the positional relationship of each color in the C r Cb coordinates. The positional relationship between the colors shown here is ITU-R BT. It is calculated based on the 709 standard. As shown in FIG. 3, for example, θ = 50 ° corresponds to magenta (M), θ = 103 ° corresponds to red (R), θ = 175 ° corresponds to yellow (Ye), and θ = 230 °. Corresponds to green (G), θ = 283 ° corresponds to cyan (C), and θ = 355 ° corresponds to blue (B).
 種領域抽出部10は、予め定められた輝度Y、彩度r、および色相θの範囲の条件を満たす領域を種領域として抽出し、当該種領域を示す種領域データSDを領域拡張部20に与える。 The seed region extraction unit 10 extracts a region satisfying predetermined ranges of luminance Y, saturation r, and hue θ as a seed region, and stores seed region data SD indicating the seed region in the region expansion unit 20. give.
 領域拡張部20は、種領域抽出部10と同様に、受け取った入力画像データIDのうちの第1色差データCbおよび第2色差データCrから、式(1)により彩度rおよび色相θを求める。なお、このような彩度rおよび色相θの算出は、種領域抽出部10と領域拡張部20とで共通に行っても良い。領域拡張部20は、種領域データSDが示す種領域と、当該種領域に基づく後述の拡張処理により得られた領域とを対象領域として取得する。なお、領域拡張部20により取得される対象領域に対しては、実際には補正部30による所定の補正処理を行うことが望ましい。このような補正処理前後の対象領域を区別するために、以下では、領域拡張部20により取得される対象領域のことを「補正前対象領域」といい、補正部30により取得される補正処理後の対象領域のことを「補正後対象領域」という。領域拡張部20は、補正前対象領域を示す補正前対象領域データEDcを補正部30に与える。 Similar to the seed region extraction unit 10, the region expansion unit 20 uses the first color difference data C b and the second color difference data C r in the received input image data ID to calculate the saturation r and the hue θ using Equation (1). Ask for. Note that the calculation of the saturation r and the hue θ may be performed by the seed region extraction unit 10 and the region expansion unit 20 in common. The area expansion unit 20 acquires, as target areas, a seed area indicated by the seed area data SD and an area obtained by an expansion process described later based on the seed area. It should be noted that it is actually desirable to perform a predetermined correction process by the correction unit 30 on the target region acquired by the region expansion unit 20. In order to distinguish the target areas before and after such correction processing, the target area acquired by the area expansion unit 20 is hereinafter referred to as “target area before correction”, and after correction processing acquired by the correction unit 30. This target area is referred to as a “target area after correction”. The area expanding unit 20 provides the correction unit 30 with the pre-correction target area data EDc indicating the pre-correction target area.
 補正部30は、補正前対象領域データEDcが示す補正前対象領域に所定の補正処理を施すことにより、補正後対象領域を取得し、それを示す抽出データEDを外部に出力する。 The correction unit 30 performs a predetermined correction process on the pre-correction target area indicated by the pre-correction target area data EDc, thereby obtaining the post-correction target area, and outputs extracted data ED indicating the acquired target area to the outside.
 <1.2 抽出処理>
 図4は、本実施形態における画像処理プログラムのフローチャートである。ステップS1,S2は種領域抽出部10に対応し、ステップS3は領域拡張部20に対応し、ステップS4は補正部30に対応する。種領域抽出部10、領域拡張部20、および補正部30は、CPU1が図4に示す画像処理プログラムの各ステップを実行することによりソフトウェア的に実現される。
<1.2 Extraction process>
FIG. 4 is a flowchart of the image processing program in the present embodiment. Steps S1 and S2 correspond to the seed region extraction unit 10, step S3 corresponds to the region expansion unit 20, and step S4 corresponds to the correction unit 30. The seed region extraction unit 10, the region expansion unit 20, and the correction unit 30 are realized in software by the CPU 1 executing each step of the image processing program shown in FIG.
 図5は、本実施形態における画像処理プログラムを見本画像に対して適用した例を示す図である。より詳細には、図5(A)は、見本画像を示す図である。図5(B)は、指定色の領域を抽出した処理結果を示す図である。ここで、「指定色」とは、抽出すべき補正後対象領域の色をいう。図5(C)は、種領域を抽出した処理結果を示す図である。図5(D)は、拡張処理を行った結果を示す図である。図5(E)は、後述の穴埋め処理を行った結果を示す図である。図5(A)の見本画像では、画像の右側には帽子を被った女性が描写され、画像の左側には花が描写されている。なお、この図5(A)の見本画像は実際にはカラー画像である点に留意されたい。図5(B)~図5(E)は例えば表示上は2値画像であるが、これらに関する各種計算では例えばカラー画像として扱われる。以下では、本画像処理プログラムにより、図5(A)に示す見本画像から、補正後対象領域として顔を抽出するものとして説明するが、本発明はこれに限定されるものではない。本画像処理プログラムは、顔に限らずその他の画素変化の小さい領域(例えば、顔以外の皮膚、青空、または海など)の抽出に適用可能である。この点は、後述の第2,第3の実施形態でも同様である。また、見本画像に関する説明でいう「顔」とは、当該見本画像中の女性の顔および首からなる部分をいうものとする。また、以下では、各ステップで取得(抽出)された領域(図5(B)~図5(E)の画像において白で示される領域)のことを「白領域」ということがあり、取得(抽出)されていない領域(図5(B)~図5(E)の画像において黒で示される領域)のことを「黒領域」ということがある。 FIG. 5 is a diagram showing an example in which the image processing program in the present embodiment is applied to a sample image. More specifically, FIG. 5A is a diagram showing a sample image. FIG. 5B is a diagram illustrating a processing result obtained by extracting a designated color region. Here, the “designated color” refers to the color of the corrected target area to be extracted. FIG. 5C is a diagram illustrating a processing result of extracting the seed region. FIG. 5D is a diagram illustrating a result of performing the extension process. FIG. 5E is a diagram illustrating a result of performing a filling process described later. In the sample image of FIG. 5A, a woman wearing a hat is depicted on the right side of the image, and a flower is depicted on the left side of the image. It should be noted that the sample image in FIG. 5A is actually a color image. 5B to 5E are, for example, binary images on display, but are handled as color images, for example, in various calculations related to these images. The following description will be made assuming that the face is extracted as the corrected target area from the sample image shown in FIG. 5A by the image processing program, but the present invention is not limited to this. This image processing program is applicable not only to the extraction of a region with a small pixel change (for example, skin other than the face, blue sky, or sea). This also applies to second and third embodiments described later. In addition, the “face” in the description relating to the sample image refers to a portion made up of a female face and neck in the sample image. In the following, the area acquired (extracted) in each step (the area shown in white in the images of FIGS. 5B to 5E) may be referred to as a “white area”. An area that has not been extracted (area shown in black in the images of FIGS. 5B to 5E) may be referred to as a “black area”.
 まず、ステップS1において、見本画像の中から、指定色、例えば肌色の領域が抽出される。本実施形態では、指定色(肌色)を特定するための条件(以下「指定色特定条件」という。)として、輝度Y、彩度r、および色相θの範囲に関する条件(以下「範囲特定条件」という。)を用いる。以下では、輝度Y、彩度r、および色相θの範囲のことをそれぞれ「輝度範囲」、「彩度範囲」、および「色相範囲」という。範囲特定条件は、次式(2)で与えられる。
Figure JPOXMLDOC01-appb-M000002
 ここで、Y1,Y2はそれぞれ、肌色を特定するための輝度範囲の下限閾値および上限閾値である。r1,r2はそれぞれ、肌色を特定するための彩度範囲の下限閾値および上限閾値である。θ1,θ2はそれぞれ、肌色を特定するための色相範囲の下限閾値および上限閾値である。図6は、Crb座標において、式(2)に示す彩度範囲および色相範囲を満たす範囲を模式的に示す図である。図6において、太線で囲まれた部分が式(2)に示す彩度範囲および色相範囲を満たす範囲である。種領域抽出部10は、式(2)に示す輝度範囲、彩度範囲、および色相範囲の全てが満たされるときには範囲特定条件が満たされると判定し、当該範囲特定条件を満たす領域を抽出すべき肌色の領域であるとする。この抽出結果は、図5(B)に示される。図5(B)から、ステップS1では、本来抽出されるべき顔の一部が抽出されていないことがわかる。これは、顔においても範囲特定条件を満たさない領域が存在するためである。また、本来抽出されるべきでない帽子の一部および花の一部などが抽出されていることがわかる。これは、顔のみならず、帽子および花などにおいても範囲特定条件を満たす領域が存在するためである。このステップS1は、例えば従来の閾値領域抽出と同様の処理に相当する。
First, in step S1, a specified color, for example, a skin color region is extracted from the sample image. In the present embodiment, as a condition for specifying a specified color (skin color) (hereinafter referred to as “specified color specifying condition”), a condition relating to a range of luminance Y, saturation r, and hue θ (hereinafter referred to as “range specifying condition”). Is used). Hereinafter, the ranges of luminance Y, saturation r, and hue θ are referred to as “luminance range”, “saturation range”, and “hue range”, respectively. The range specifying condition is given by the following equation (2).
Figure JPOXMLDOC01-appb-M000002
Here, Y 1 and Y 2 are a lower limit threshold and an upper limit threshold of the luminance range for specifying the skin color, respectively. r 1 and r 2 are a lower limit threshold and an upper limit threshold of the saturation range for specifying the skin color, respectively. θ 1 and θ 2 are a lower limit threshold and an upper limit threshold of the hue range for specifying the skin color, respectively. FIG. 6 is a diagram schematically showing a range satisfying the saturation range and hue range shown in Expression (2) in the C r Cb coordinates. In FIG. 6, a portion surrounded by a thick line is a range that satisfies the saturation range and hue range shown in Expression (2). The seed region extraction unit 10 determines that the range specifying condition is satisfied when all of the luminance range, saturation range, and hue range shown in Expression (2) are satisfied, and should extract a region that satisfies the range specifying condition Suppose that it is a skin color area. The extraction result is shown in FIG. FIG. 5B shows that in step S1, a part of the face that should be extracted is not extracted. This is because there is a region that does not satisfy the range specifying condition even in the face. It can also be seen that a part of the hat and a part of the flower that should not be extracted are extracted. This is because not only the face but also a hat and a flower have regions that satisfy the range specifying condition. This step S1 corresponds to, for example, the same processing as the conventional threshold area extraction.
 次に、ステップS2において、ステップS1で抽出された白領域(顔のみならず、帽子の一部および花の一部をも含む。)から種領域が抽出される。より詳細には、ステップS1で抽出した白領域の中から、面積に関する第1の所定の条件を満たす領域が種領域として抽出される。本実施形態における「面積に関する第1の所定の条件」は、ステップS1で抽出された白領域のうちで面積が最大である条件である。このため、ステップS1で抽出した白領域の中から、最大面積の領域が種領域として抽出される。この抽出結果は、図5(C)に示される。ステップS1で抽出された白領域の中で、顔に対応する領域である顔領域(ただし、その一部は欠けている。)が最大の面積を有するので、当該顔領域が種領域として抽出される。なお、ここでは最大面積の領域を種領域として抽出するものとしたが、本発明はこれに限定されるものではない。例えば、領域の面積および/または形状に基づいて種領域を抽出することができる。領域形状の判定手法としては、例えば円形度が所定値以上である領域を所望の形状であると判定する手法が知られている。円形度は、次式(3)で与えられる。
  C=4πS/L2 …(3)
 ここで、Cは円形度であり、Sは判定対象の領域の面積であり、Lは当該領域の周囲長である。このように形状を考慮した種領域の抽出は特に、顔などの特定の形状を有する領域の抽出に好適である。ここまでの処理では、顔領域の全体を完全には抽出できていない。このため、このような欠落がある抽出結果を用いて顔認識などの処理を行うと誤動作を生じさせるおそれがある。ただし、ステップS2で得られた種領域の色を顔色として、特許文献2に係るシステムのようにホワイトバランスを調整することができる。
Next, in step S2, a seed region is extracted from the white region (including not only the face but also part of the hat and part of the flower) extracted in step S1. More specifically, a region that satisfies the first predetermined condition regarding the area is extracted as a seed region from the white region extracted in step S1. The “first predetermined condition relating to the area” in the present embodiment is a condition in which the area is the maximum among the white regions extracted in step S1. For this reason, a region having the maximum area is extracted as a seed region from the white regions extracted in step S1. The extraction result is shown in FIG. Among the white areas extracted in step S1, the face area that is the area corresponding to the face (however, part of it is missing) has the largest area, so that the face area is extracted as the seed area. The Here, the region having the maximum area is extracted as the seed region, but the present invention is not limited to this. For example, the seed region can be extracted based on the area and / or shape of the region. As a method for determining the region shape, for example, a method for determining a region having a circularity of a predetermined value or more as a desired shape is known. The circularity is given by the following equation (3).
C = 4πS / L 2 (3)
Here, C is the circularity, S is the area of the determination target region, and L is the perimeter of the region. The extraction of the seed region in consideration of the shape in this way is particularly suitable for extracting a region having a specific shape such as a face. In the process so far, the entire face area has not been completely extracted. For this reason, if a process such as face recognition is performed using an extraction result having such a lack, a malfunction may occur. However, the white balance can be adjusted as in the system according to Patent Document 2, using the color of the seed region obtained in step S2 as the face color.
 次に、ステップS3において、ステップS2で得られた種領域の周辺の領域で所定の条件が満たされるか否か判定して当該条件を満たすと判定された領域を補正前対象領域に含め、かつ、補正前対象領域に新たに含められた領域の周辺の領域で当該条件が満たされるか否か判定して当該条件を満たすと判定された領域を補正前対象領域に含めることにより、当該条件を満たすと判定された領域および種領域を補正前対象領域として取得する。このように、ステップS3では、種領域のみならず上記所定の条件を満たすと判定された領域が対象領域に含まれることになる。すなわち、種領域が拡張されるかのような処理が行われる。このため、本明細書では、対象領域に、上記所定の条件を満たすと判定された領域を含めるためのステップS3の処理のことを「拡張処理」という。この拡張処理の結果は、図5(D)に示される。図5(D)から、ステップS2で得られた種領域よりも正確に顔領域を抽出できていることがわかる。ただし、ステップS3で得られる補正前対象領域の外周内には、当該補正前対象領域の内周に接する、眉、顔、鼻、および口などに相当する黒領域が位置している。なお、ステップS3の詳細については後述する。 Next, in step S3, it is determined whether or not a predetermined condition is satisfied in an area around the seed area obtained in step S2, and an area determined to satisfy the condition is included in the pre-correction target area, and Determining whether or not the condition is satisfied in an area around the area newly included in the pre-correction target area and including the area determined to satisfy the condition in the pre-correction target area. An area determined to satisfy and a seed area are acquired as a pre-correction target area. Thus, in step S3, not only the seed region but also the region determined to satisfy the predetermined condition is included in the target region. That is, processing as if the seed region is expanded is performed. For this reason, in this specification, the process of step S3 for including the area determined to satisfy the predetermined condition in the target area is referred to as an “expansion process”. The result of this expansion process is shown in FIG. FIG. 5D shows that the face area can be extracted more accurately than the seed area obtained in step S2. However, in the outer periphery of the pre-correction target area obtained in step S3, black areas corresponding to the inner periphery of the pre-correction target area and corresponding to the eyebrows, the face, the nose, the mouth, and the like are located. Details of step S3 will be described later.
 最後に、ステップS4において、白領域(補正前対象領域)の内周に接する黒領域を白領域に置換する、いわゆる穴埋め処理が行われることにより、上述の補正後対象領域が抽出される。穴埋め処理は、例えば白領域の内周に接する黒領域のうちの、面積が所定値以下の黒領域を白領域に置換する処理である。この穴埋め処理後の結果は、図5(E)に示される。図5(E)から、顔領域全体を抽出できていることがわかる。 Finally, in step S4, the above-described corrected target area is extracted by performing a so-called hole filling process in which the black area in contact with the inner periphery of the white area (target area before correction) is replaced with the white area. The hole filling process is a process of replacing, for example, a black area whose area is equal to or smaller than a predetermined value among black areas in contact with the inner periphery of the white area. The result after the hole filling process is shown in FIG. FIG. 5E shows that the entire face area has been extracted.
 <1.3 拡張処理>
 拡張処理は、種領域中の各画素を起点として、後述の勾配特定条件を満たすか否かを判定することにより行われる。より詳細には、拡張処理は、種領域中の各画素を注目画素(拡張処理において行われる勾配特定条件の判定で中心となる画素をいう。)として、当該注目画素の周辺の画素が勾配特定条件を満たすか否かを判定し、当該条件を満たせば当該判定対象の画素を補正前対象領域に含める処理(以下「第1の拡張処理」という。)と、第1の拡張処理により新たに対象領域に含められた画素を注目画素として、当該注目画素の周辺の画素が勾配特定条件を満たすか否かを判定し、当該条件を満たせば当該判定対象の画素を補正前対象領域に含めることを繰り返す処理(以下「第2の拡張処理」という。)とを含んでいる。
<1.3 Extended processing>
The expansion process is performed by determining whether or not a gradient specifying condition described later is satisfied, starting from each pixel in the seed region. More specifically, in the extension process, each pixel in the seed region is set as a target pixel (referred to as a central pixel in the determination of the gradient specifying condition performed in the extension process), and pixels around the target pixel are specified in the gradient. It is determined whether or not the condition is satisfied, and if the condition is satisfied, a process of including the determination target pixel in the pre-correction target area (hereinafter referred to as “first extension process”) and a first extension process are newly performed. Using a pixel included in the target region as a target pixel, determine whether or not pixels around the target pixel satisfy the gradient specifying condition, and if the condition is satisfied, include the target pixel in the pre-correction target region (Hereinafter referred to as “second extension process”).
 図7は、図4におけるステップS3(拡張処理)の詳細を示すフローチャートである。図7に示すように、ステップS3はステップS31~S34,S34a,S35,S35aからなる。以下では、画像の水平方向を「X方向」といい、垂直方向を「Y方向」という。また、X方向およびY方向における座標(X座標およびY座標)の位置を表す変数をそれぞれx,yとする。なお、x=1~mであり、y=1~nである(m,nは1以上の整数)。各画素にはフラグが設定されている。画素が白領域に属していればフラグは1になっており、画素が黒領域に属していればフラグは0になっている。なお、以下では各画素のフラグの値をFで表し、特に、X座標がx、Y座標がyである画素(以下、座標(x,y)の画素という。)のフラグの値をF(x,y)で表す。 FIG. 7 is a flowchart showing details of step S3 (extension processing) in FIG. As shown in FIG. 7, step S3 includes steps S31 to S34, S34a, S35, and S35a. Hereinafter, the horizontal direction of the image is referred to as “X direction”, and the vertical direction is referred to as “Y direction”. Also, variables representing the positions of the coordinates in the X direction and the Y direction (X coordinate and Y coordinate) are x and y, respectively. Note that x = 1 to m and y = 1 to n (m and n are integers of 1 or more). A flag is set for each pixel. The flag is 1 if the pixel belongs to the white area, and the flag is 0 if the pixel belongs to the black area. In the following, the flag value of each pixel is represented by F, and in particular, the flag value of a pixel whose X coordinate is x and Y coordinate is y (hereinafter referred to as a pixel of coordinates (x, y)) is F ( x, y).
 図4におけるステップS2の後、まず、ステップS31においてyが1にセットされる。次に、ステップS32においてxが1にセットされる。そして、ステップS33において、座標(x,y)の画素を起点とした拡張処理が行われる。このステップS33の詳細は後述する。次に、ステップS34ではx=mであるか否かが判定される。x=mでなければステップS34aに進み、x=mであればステップS35に進む。ステップS34aにおいてxがインクリメントされ、その後ステップS33に進む。ステップS35では、y=nであるか否かが判定される。y=nでなければステップS35aに進み、y=nであれば図4におけるステップS4に進む。ステップS35aにおいてyがインクリメントされ、その後ステップS32に進む。 After step S2 in FIG. 4, first, y is set to 1 in step S31. Next, x is set to 1 in step S32. In step S33, an expansion process is performed with the pixel at the coordinates (x, y) as the starting point. Details of step S33 will be described later. Next, in step S34, it is determined whether x = m. If x = m, the process proceeds to step S34a, and if x = m, the process proceeds to step S35. In step S34a, x is incremented, and then the process proceeds to step S33. In step S35, it is determined whether y = n. If y = n, the process proceeds to step S35a, and if y = n, the process proceeds to step S4 in FIG. In step S35a, y is incremented, and then the process proceeds to step S32.
 次に、ステップS33の詳細について説明する。図8は、図7におけるステップS33の詳細を示すフローチャートである。図8に示すように、ステップS33は、ステップS331~S335からなる。ステップS331~S335のうちのステップS332~334は第1の拡張処理に相当し、ステップS333~S335(より詳細には、ステップS333~S335の繰り返し)は第2の拡張処理に相当する。図9~図11は、拡張処理の例を説明するための図である。図9~図11において、右向き矢印はX方向を示し、下向き矢印はY方向を示している。図9~図11における各ブロックは1つの画素を示していており、ここでは説明の便宜上、m=n=20であるとする。図9において、色の濃いブロックはF=1である画素(以下「種領域画素」という。)に対応し、ハッチングが付されたブロックと、それらの色の濃いブロックおよびハッチングが付されたブロック以外のブロック(白いブロック)とはF=0である画素(以下「黒領域画素」という。)に対応する。ハッチング付されたブロックはまた、顔領域として本来抽出されるべきであるが種領域としては抽出されずに黒領域画素となっている画素(以下「見込種領域画素」という。)に対応する。図10では、図9における種領域画素に1を付している。なお、黒領域画素には0を付すべきではあるが、ここでは便宜上省略している。また、図9における見込種領域画素の外周を破線で示し、後述の拡張処理対象の範囲を太線で示している。なお、この図10に関する説明は、座標(12,7)および(11,8)の画素を除き、図11に関しても同様である。 Next, details of step S33 will be described. FIG. 8 is a flowchart showing details of step S33 in FIG. As shown in FIG. 8, step S33 includes steps S331 to S335. Of steps S331 to S335, steps S332 to 334 correspond to the first extension process, and steps S333 to S335 (more specifically, repetition of steps S333 to S335) correspond to the second extension process. 9 to 11 are diagrams for explaining an example of the extension process. 9 to 11, the rightward arrow indicates the X direction, and the downward arrow indicates the Y direction. Each block in FIGS. 9 to 11 shows one pixel. Here, for convenience of explanation, it is assumed that m = n = 20. In FIG. 9, dark blocks correspond to pixels with F = 1 (hereinafter referred to as “seed region pixels”), hatched blocks, dark blocks, and hatched blocks. Blocks other than (white blocks) correspond to pixels with F = 0 (hereinafter referred to as “black area pixels”). The hatched blocks also correspond to pixels that should be extracted as face regions but are not extracted as seed regions but are black region pixels (hereinafter referred to as “probable seed region pixels”). In FIG. 10, 1 is attached to the seed region pixel in FIG. In addition, although 0 should be attached to the black region pixel, it is omitted here for convenience. Further, the outer periphery of the expected seed region pixel in FIG. 9 is indicated by a broken line, and a range to be expanded (described later) is indicated by a thick line. Note that the description regarding FIG. 10 is the same with respect to FIG. 11 except for the pixel at the coordinates (12, 7) and (11, 8).
 まず、ステップS331において、F(x,y)=1であるか否かが判定される。F(x,y)=1でなければ図7におけるステップS34に進み、F(x,y)=1であればステップS332に進む。図10に示す例では、各画素についてステップS33が繰り返される中で、座標(12,8)の画素で初めてステップS332に進む。 First, in step S331, it is determined whether F (x, y) = 1. If F (x, y) = 1, the process proceeds to step S34 in FIG. 7, and if F (x, y) = 1, the process proceeds to step S332. In the example shown in FIG. 10, while step S33 is repeated for each pixel, the process proceeds to step S332 for the first time at the pixel of coordinates (12, 8).
 ステップS332において、座標(x,y)の画素の周辺にF=0の画素が存在するか否か、すなわち、座標(x,y)の画素を注目画素とした拡張処理対象中にF=0の画素が存在するか否かが判定される。F=0の画素が存在しなければ図7におけるステップS34に進み、F=0の画素が存在すればステップS333に進む。ここで、拡張処理対象は、例えば図12(A)に示すように注目画素の4近傍隣接画素とすることができ、または、図12(B)に示すように注目画素の8近傍隣接画素とすることができる。なお、図12(A)および図12(B)では太線で囲まれた、F=(i,j)である画素が注目画素である(i=1~m,j=1~n)。以下では、拡張処理対象が注目画素の4近傍隣接画素であるものとして説明するが、拡張処理対象が注目画素の8近傍隣接画素である場合にも同様の説明が成り立つ。図10に示す例では、座標(12,8)の画素が注目画素であり、その4近傍隣接画素である座標(12,7)、(11,8)、(13,8)、および(12,9)の画素が拡張処理対象となる。 In step S332, whether or not there is a pixel with F = 0 in the vicinity of the pixel with the coordinate (x, y), that is, F = 0 during the extension processing target with the pixel with the coordinate (x, y) as the target pixel. It is determined whether or not there are pixels. If there is no pixel with F = 0, the process proceeds to step S34 in FIG. 7, and if there is a pixel with F = 0, the process proceeds to step S333. Here, for example, as shown in FIG. 12A, the extension processing target can be four neighboring neighboring pixels of the pixel of interest, or eight neighboring neighboring pixels of the pixel of interest as shown in FIG. can do. Note that in FIG. 12A and FIG. 12B, a pixel with F = (i, j) surrounded by a thick line is a target pixel (i = 1 to m, j = 1 to n). In the following description, it is assumed that the extension processing target is four neighboring adjacent pixels of the target pixel. However, the same description holds when the extension processing target is eight neighboring neighboring pixels of the target pixel. In the example shown in FIG. 10, the pixel at the coordinate (12, 8) is the target pixel, and the coordinates (12, 7), (11, 8), (13, 8), and (12) that are the four neighboring pixels. , 9) is an extension processing target.
 ステップS333について説明する前に、隣接画素間での輝度Y、彩度r、および色相θの勾配について説明する。なお、以下では、輝度Y、彩度r、および色相θの勾配のことをそれぞれ「輝度勾配」、「彩度勾配」および「色相勾配」といい、それそれぞれ符号Y’,r’,θ’で表す。これらの勾配の算出には、例えばロバーツフィルタ、プレウィットフィルタ、またはソーベルフィルタなどを用いることができる。図13(A)は、45度方向のロバーツフィルタを示す図である。図13(B)は、135度方向のロバーツフィルタを示す図である。図13(C)は、水平方向のプレウィットフィルタを示す図である。図13(D)は、垂直方向のプレウィットフィルタを示す図である。図13(E)は、水平方向のソーベルフィルタを示す図である。図13(F)は、垂直方向のソーベルフィルタを示す図である。なお、ここではフィルタサイズを3×3としているが、本発明はこれに限定されるものではない。 Before describing step S333, the gradient of luminance Y, saturation r, and hue θ between adjacent pixels will be described. In the following, the gradients of luminance Y, saturation r, and hue θ are referred to as “luminance gradient”, “saturation gradient”, and “hue gradient”, respectively, and are denoted by Y ′, r ′, θ ′, respectively. Represented by For calculation of these gradients, for example, a Roberts filter, a pre-witt filter, or a Sobel filter can be used. FIG. 13A is a diagram illustrating a 45-degree Roberts filter. FIG. 13B is a diagram illustrating a 135 degree direction Roberts filter. FIG. 13C is a diagram showing a pre-wit filter in the horizontal direction. FIG. 13D is a diagram illustrating a pre-wit filter in the vertical direction. FIG. 13E shows a horizontal Sobel filter. FIG. 13F is a diagram illustrating a vertical Sobel filter. Although the filter size is 3 × 3 here, the present invention is not limited to this.
 輝度勾配Y’、彩度勾配r’、および色相勾配θ’は、次式(4)により算出される。
Figure JPOXMLDOC01-appb-M000003
 ここで、Yh’は第1方向(45°方向または水平方向)の輝度勾配であり、ロバーツフィルタを用いる場合には図13(A)に示すフィルタにより算出され、プレウィットフィルタを用いる場合には図13(C)に示すフィルタにより算出され、ソーベルフィルタを用いる場合には図13(E)に示すフィルタにより算出される。また、Yv’は第2方向(135°方向または垂直方向)の輝度勾配であり、ロバーツフィルタを用いる場合には図13(B)に示すフィルタにより算出され、プレウィットフィルタを用いる場合には図13(D)に示すフィルタにより算出され、ソーベルフィルタを用いる場合には図13(F)に示すフィルタにより算出される。
The luminance gradient Y ′, the saturation gradient r ′, and the hue gradient θ ′ are calculated by the following equation (4).
Figure JPOXMLDOC01-appb-M000003
Here, Y h ′ is a luminance gradient in the first direction (45 ° direction or horizontal direction), and is calculated by the filter shown in FIG. 13A when the Roberts filter is used, and when the pre-wit filter is used. Is calculated by the filter shown in FIG. 13C, and when using a Sobel filter, it is calculated by the filter shown in FIG. Y v ′ is a luminance gradient in the second direction (135 ° direction or vertical direction), and is calculated by the filter shown in FIG. 13B when the Roberts filter is used, and when the pre-wit filter is used. It is calculated by the filter shown in FIG. 13D, and when using a Sobel filter, it is calculated by the filter shown in FIG.
 ステップS333では、拡張処理対象のF=0の画素が、次式(5)で与えられる、輝度勾配Y’、彩度勾配r’、および色相勾配θ’に関する条件(以下「勾配特定条件」という。)を満たすか否かが判定される。
Figure JPOXMLDOC01-appb-M000004
 ここで、Ya’,ra’,θa’はそれぞれ、勾配の比較的緩やかな画素を特定するための輝度勾配Y’の閾値、彩度勾配r’の閾値、および色相勾配θ’の閾値である。これらの閾値は第1閾値に相当する。式(5)に示すように、輝度勾配Y’が閾値Ya’よりも小さく、彩度勾配r’が閾値ra’より小さく、色彩勾配θ’が閾値θa’よりも小さいときには、拡張処理対象のF=0の画素が勾配特定条件を満たすと判定される。この勾配特定条件を満たすということは、拡張処理対象であるF=0の画素の勾配が比較的緩やかであることを意味する。例えば顔などの画素変化の小さい領域は勾配が比較的緩やかであるので、この勾配特定条件を満たすF=0の画素は見込種領域画素とみなすことができる。例えば図10に示す例では、座標(12,7)および(11,8)の画素が式(5)に示す勾配特定条件を満たす。なお、座標(13,8)および(12,9)の画素については、F=1であるので、式(5)に示す勾配特定条件を満たすか否かの判定対象には含まれない。拡張処理対象中のF=0の画素が式(5)を満たさなければ図7におけるステップS34に進み、式(5)を満たせばステップS334に進む。なお、拡張処理対象中にF=0の画素が複数存在する場合には、例えば、ステップS333~S335は1つの画素毎に行われるかまたは複数の画素について並列に行われる。以下では説明の便宜上、ステップS333~S335がF=0の複数の画素について並列に行われるようにして説明する。
In step S333, the pixel with F = 0 as the extension process target is a condition relating to the luminance gradient Y ′, the saturation gradient r ′, and the hue gradient θ ′ given by the following equation (5) (hereinafter referred to as “gradient specifying condition”). .) Is satisfied.
Figure JPOXMLDOC01-appb-M000004
Here, Y a ′, r a ′, and θ a ′ are respectively the threshold value of the luminance gradient Y ′, the threshold value of the saturation gradient r ′, and the hue gradient θ ′ for specifying pixels having relatively gentle gradients. It is a threshold value. These threshold values correspond to the first threshold value. As shown in Equation (5), the luminance gradient Y 'is the threshold Y a' smaller than the saturation gradient r 'is the threshold r a' smaller than that when the color gradient theta 'threshold theta a' smaller than the extended It is determined that the pixel of processing target F = 0 satisfies the gradient specifying condition. Satisfying this gradient specifying condition means that the gradient of the pixel of F = 0 that is the target of the extension processing is relatively gentle. For example, an area with small pixel change such as a face has a relatively gentle gradient. Therefore, a pixel of F = 0 that satisfies the gradient specifying condition can be regarded as a potential seed area pixel. For example, in the example shown in FIG. 10, the pixels of coordinates (12, 7) and (11, 8) satisfy the gradient specifying condition shown in equation (5). In addition, about the pixel of coordinates (13,8) and (12,9), since F = 1, it is not included in the determination object whether the gradient specific condition shown in Formula (5) is satisfied. If the pixel of F = 0 that is subject to the expansion process does not satisfy Expression (5), the process proceeds to Step S34 in FIG. 7, and if the expression (5) is satisfied, the process proceeds to Step S334. When there are a plurality of pixels with F = 0 in the expansion processing target, for example, steps S333 to S335 are performed for each pixel or performed in parallel for the plurality of pixels. In the following, for the sake of convenience of explanation, steps S333 to S335 are described in parallel for a plurality of pixels with F = 0.
 ステップS334では、式(5)を満たすF=0の画素について、フラグをF=1に変換する。このため、式(5)を満たす座標(12,7)および(11,8)の画素については、図11に示すようにフラグがF=1に変換される。すなわち、見込種領域画素とみなされた座標(12,7)および(11,8)の画素が補正前対象領域に含まれる。ここまでが、第1の拡張処理である。 In step S334, the flag is converted to F = 1 for the pixel of F = 0 that satisfies Expression (5). For this reason, for the pixels at coordinates (12, 7) and (11, 8) satisfying the expression (5), the flag is converted to F = 1 as shown in FIG. That is, the pixels at coordinates (12, 7) and (11, 8) that are regarded as the expected seed region pixels are included in the pre-correction target region. This is the first extension process.
 ステップS335では、フラグをF=1に変換した画素の周辺にF=0の画素が存在するか否か、すなわち、当該画素を注目画素とした拡張処理対象中にF=0の画素が存在するか否かが判定される。F=0の画素が存在しなければ図7におけるステップS34に進み、F=0の画素が存在すればステップS333に進む。このようにして、新たにフラグをF=1に変換した画素(補正前対象領域に含まれた見込種領域画素)を注目画素として、ステップS333~S335が繰り返し行われる。そして、新たにフラグをF=1に変換した画素を注目画素とした拡張処理対象中に式(5)を満たすF=0の画素が存在しなくなった時点で、第2の拡張処理が停止する(ステップS333からステップS34に進む。)。そして、このようなステップS33の処理が、画像全体にわたって行われる(ステップS3)。これにより、見込種領域画素のほぼ全て(すなわち、補正前対象領域の閉空間内に位置する見込領域画素を除く見込種領域画素)についてフラグがF=1に変換されることにより、種領域が拡張されるかのような処理が行われる。このようにして、補正前対象領域が得られる。また、式(5)を満たさないF=0の画素についてはフラグがF=1に変換されないので、見込種領域画素でない黒領域画素のフラグはF=1に変換されない。すなわち、勾配が急変する箇所(画素変化の小さい領域の境界)で拡張処理が停止する。 In step S335, whether or not there is a pixel with F = 0 in the vicinity of the pixel whose flag is converted to F = 1, that is, there is a pixel with F = 0 in the extension processing target with the pixel as the target pixel. It is determined whether or not. If there is no pixel with F = 0, the process proceeds to step S34 in FIG. 7, and if there is a pixel with F = 0, the process proceeds to step S333. In this way, Steps S333 to S335 are repeatedly performed using a pixel whose flag is newly converted to F = 1 (an expected seed region pixel included in the pre-correction target region) as a target pixel. Then, when there is no pixel with F = 0 that satisfies Expression (5) in the extension process target with the pixel whose flag is newly converted to F = 1 as the target pixel, the second extension process is stopped. (Proceed from step S333 to step S34). Then, such processing in step S33 is performed over the entire image (step S3). As a result, the flag is converted to F = 1 for almost all the expected seed area pixels (that is, the expected seed area pixels excluding the expected seed area pixels located in the closed space of the pre-correction target area). Processing as if expanded. In this way, the pre-correction target area is obtained. In addition, since the flag is not converted to F = 1 for the pixel of F = 0 that does not satisfy Expression (5), the flag of the black region pixel that is not the expected seed region pixel is not converted to F = 1. That is, the expansion process is stopped at a location where the gradient changes suddenly (a boundary between regions where the pixel change is small).
 <1.4 効果>
 本実施形態によれば、予め定められた指定色特定条件の満たす領域である種領域に基づいて、拡張処理が行われる。従来の閾値領域抽出では、この種領域が抽出すべき対象領域とされていたので、本来抽出すべき対象領域に欠落が生じていた。しかし、本実施形態では、拡張処理により、見込種領域画素が対象領域に含まれる。このため、抽出すべき対象領域に欠落をさせず、その対象領域のほぼ全体を抽出できる。これにより、抽出した対象領域を用いて、顔認識または顔色補正などの種々の画像処理を適切に行うことができる。また、SVM(Support Vector Machine)などの高コストな認識技術を用いないので、低コスト化を図ることができる。
<1.4 Effect>
According to the present embodiment, the expansion process is performed based on a seed region that is a region that satisfies a predetermined specified color specifying condition. In the conventional threshold area extraction, since this kind of area is set as the target area to be extracted, the target area to be extracted originally lacks. However, in the present embodiment, the expected seed region pixel is included in the target region by the expansion process. For this reason, it is possible to extract almost the entire target region without missing the target region to be extracted. Accordingly, various image processing such as face recognition or face color correction can be appropriately performed using the extracted target region. In addition, since high-cost recognition technology such as SVM (Support Vector Machine) is not used, the cost can be reduced.
 また、本実施形態によれば、穴埋め処理を行うことにより、抽出すべき対象領域の欠落をより十分に抑制することができる。 Further, according to the present embodiment, the omission of the target region to be extracted can be more sufficiently suppressed by performing the hole filling process.
 <1.5 変形例>
 上記第1の実施形態では、ステップS1での指定色特定条件として、範囲特定条件のみを用いていたが、さらに勾配特定条件を用いても良い。すなわち、範囲特定条件および勾配特定条件の双方を満たすときに、指定色特定条件を満たすものとしても良い。以下では、指定色特定条件として用いられる範囲特定条件と、ステップS333において拡張処理に用いられる勾配特定条件とを区別するために、前者を「抽出用範囲特定条件」といい、後者を「拡張用範囲特定条件」という。拡張用範囲特定条件は上述のように式(5)で与えられる。一方、抽出用範囲特定条件は次式(6)で与えられる。
Figure JPOXMLDOC01-appb-M000005
 ここで、Yb’,rb’,θb’はそれぞれ、勾配の比較的緩やかな画素を特定するための輝度勾配Y’の閾値、彩度勾配r’の閾値、および色相勾配θ’の閾値である。これらの閾値は第2閾値に相当する。また、抽出用範囲特定条件に係る閾値と拡張用範囲特定条件に係る閾値との関係は、次式(7)で与えられる。
Figure JPOXMLDOC01-appb-M000006
 式(7)からわかるとおり、拡張範囲特定条件よりも抽出用範囲特定条件の方が厳しく設定される。
<1.5 Modification>
In the first embodiment, only the range specifying condition is used as the specified color specifying condition in step S1, but a gradient specifying condition may be further used. That is, the specified color specifying condition may be satisfied when both the range specifying condition and the gradient specifying condition are satisfied. Hereinafter, in order to distinguish the range specifying condition used as the specified color specifying condition from the gradient specifying condition used in the expansion process in step S333, the former is referred to as “extraction range specifying condition” and the latter is referred to as “extended use specifying condition”. This is called “range identification condition”. The expansion range specifying condition is given by the equation (5) as described above. On the other hand, the extraction range specifying condition is given by the following equation (6).
Figure JPOXMLDOC01-appb-M000005
Here, Y b ′, r b ′, and θ b ′ are respectively a luminance gradient Y ′ threshold, a saturation gradient r ′ threshold, and a hue gradient θ ′ for specifying a relatively gentle pixel. It is a threshold value. These threshold values correspond to the second threshold value. The relationship between the threshold value related to the extraction range specifying condition and the threshold value related to the expansion range specifying condition is given by the following equation (7).
Figure JPOXMLDOC01-appb-M000006
As can be seen from Expression (7), the extraction range specifying condition is set more strictly than the extended range specifying condition.
 以上のように、指定色特定条件に抽出用範囲特定条件を加えることにより、勾配の大きい領域、すなわち、顔などの画素変化の小さい領域以外の領域を種領域から除外できる。また、抽出用範囲特定条件を拡張範囲特定条件よりも厳しく設定することにより、顔などの画素変化の小さい領域以外の領域を、種領域からより確実に除外できる。このため、より正確な(すなわちノイズの少ない)種領域を拡張処理において用いることができる。これにより、対象領域の抽出精度を高めることができる。なお、本変形例に限らず、抽出用範囲特定条件を拡張用範囲特定条件と同じにしても良い。すなわち、Ya’=Yb’、ra’=rb’、θa’=θb’としても良い。 As described above, by adding the extraction range specifying condition to the specified color specifying condition, an area having a large gradient, that is, an area other than an area having a small pixel change such as a face can be excluded from the seed area. In addition, by setting the extraction range specifying condition more strictly than the extended range specifying condition, it is possible to more reliably exclude regions other than the region where the pixel change is small, such as a face, from the seed region. For this reason, a more accurate (that is, less noise) seed region can be used in the expansion process. Thereby, the extraction accuracy of the target region can be increased. Note that, not limited to this modification, the extraction range specifying condition may be the same as the expansion range specifying condition. That is, Y a ′ = Y b ′, r a ′ = r b ′, and θ a ′ = θ b ′ may be set.
 <2.第2の実施形態>
 <2.1 抽出処理>
 図14は、本発明の第2の実施形態における画像処理プログラムのフローチャートである。図14に示すように、上記第1の実施形態におけるステップS2がステップS2aに代わっており、さらに、ステップS5が加わっている。なお、画像処理装置の構成などは上記第1の実施形態と同様であるので、その説明を省略する。また、抽出処理についても、上記第1の実施形態と共通する部分については適宜説明を省略する。ステップS2aは、上記第1の実施形態におけるステップS2と同様に種領域抽出部10に対応する。ステップS5は、例えば領域拡張部20に対応する。また、図15は、本実施形態における画像処理プログラムを見本画像に対して適用した例を示す図である。より詳細には、図15(A)は、見本画像を示す図である。図15(B)は、指定色の領域を抽出した処理結果を示す図である。図15(C)は、種領域を抽出した処理結果を示す図である。図15(D)は、拡張処理を行った結果を示す図である。図15(E)は、穴埋め処理を行った結果を示す図である。見本画像は、上記第1の実施形態と同様のものである、すなわち、図15(A)は図5(A)と同様のものである。また、図15(B)および図15(E)はそれぞれ図5(B)および図5(E)と同様となっている。
<2. Second Embodiment>
<2.1 Extraction process>
FIG. 14 is a flowchart of an image processing program according to the second embodiment of the present invention. As shown in FIG. 14, step S2 in the first embodiment is replaced with step S2a, and step S5 is further added. Since the configuration of the image processing apparatus is the same as that of the first embodiment, description thereof is omitted. Also, with regard to the extraction process, description of parts common to the first embodiment will be omitted as appropriate. Step S2a corresponds to the seed region extraction unit 10 as in step S2 in the first embodiment. Step S5 corresponds to the area expansion unit 20, for example. FIG. 15 is a diagram illustrating an example in which the image processing program in the present embodiment is applied to a sample image. More specifically, FIG. 15A shows a sample image. FIG. 15B is a diagram illustrating a processing result of extracting a specified color area. FIG. 15C is a diagram illustrating a processing result of extracting the seed region. FIG. 15D is a diagram illustrating a result of performing the extension process. FIG. 15E is a diagram illustrating a result of the hole filling process. The sample image is the same as that in the first embodiment, that is, FIG. 15A is the same as FIG. 5A. 15B and 15E are the same as FIGS. 5B and 5E, respectively.
 ステップS2aでは、ステップS1で抽出された白領域の中から、面積に関する第1の所定の条件を満たす領域が種領域として抽出される。ただし、上記第1の実施形態におけるステップS2と異なり、本実施形態における「面積に関する第1の所定の条件」は、ステップS1で抽出された白領域のうちで、面積が所定値以上である条件である。このため、ステップS1で抽出した白領域の中から、面積が所定値以上の領域が種領域として抽出される。この抽出結果は、図15(C)に示される。ここで、所定値以上の面積を有する領域は、例えば顔領域(ただし、その一部は欠けている。)と、帽子に対応する領域である帽子領域(ただし、その一部は欠けている。)である。このように本実施形態では、抽出すべき領域の面積値の設定に応じて、複数の種領域を抽出することができる。 In step S2a, a region that satisfies the first predetermined condition regarding the area is extracted as a seed region from the white region extracted in step S1. However, unlike step S2 in the first embodiment, the “first predetermined condition regarding the area” in the present embodiment is a condition in which the area is equal to or larger than a predetermined value in the white region extracted in step S1. It is. For this reason, a region having an area equal to or larger than a predetermined value is extracted as a seed region from the white regions extracted in step S1. The extraction result is shown in FIG. Here, for example, a region having an area equal to or larger than a predetermined value is a face region (however, part thereof is missing) and a hat region (however, part thereof is missing) corresponding to the hat. ). Thus, in the present embodiment, a plurality of seed regions can be extracted according to the setting of the area value of the region to be extracted.
 なお、ステップS3では、ステップS2aで得られた各種領域に基づいて、上記第1の実施形態と同様の処理が行われる。この処理結果は、図15(D)に示される。図15(D)から、上記第1の実施形態と同様の顔領域と共に、ステップS2で得られた種領域よりも正確に帽子領域が抽出できている。 In step S3, processing similar to that in the first embodiment is performed based on the various areas obtained in step S2a. The processing result is shown in FIG. From FIG. 15D, the hat region can be extracted more accurately than the seed region obtained in step S2 together with the face region similar to that in the first embodiment.
 次に、ステップS5では、ステップS3で抽出された白領域の中から、面積に関する第2の所定の条件を満たす領域が補正前対象領域とすべき領域が選択される。本実施形態のける「面積に関する第2の所定の条件」は、ステップS3で抽出された白領域のうちで面積が最大である条件である。このため、顔領域は補正前対象領域とされ、不要な領域である帽子領域は補正前対象領域から除外される。なお、ステップS5においても、領域の面積および/または形状に基づいて補正前対象領域を選択しても良く、上述のように円形度などを用いても良い。特に、円形度を用いた補正前対象領域の選択は、複数の顔などを抽出する場合に好適である。 Next, in step S5, a region to be selected as a pre-correction target region is selected from the white regions extracted in step S3. The “second predetermined condition relating to the area” in the present embodiment is a condition in which the area is the maximum among the white regions extracted in step S3. For this reason, the face area is a target area before correction, and the hat area, which is an unnecessary area, is excluded from the target area before correction. In step S5 as well, the pre-correction target region may be selected based on the area and / or shape of the region, and the circularity may be used as described above. In particular, the selection of the pre-correction target area using the circularity is suitable for extracting a plurality of faces and the like.
 そして、ステップS4では、ステップS5で得られた補正前対象領域に対して上記第1の実施形態と同様の穴埋め処理が施され、補正後対象領域が得られる。この結果は、図15(E)に示される。図15(E)から、上記第1の実施形態と同様の結果が得られることがわかる。 And in step S4, the same as the first embodiment, the filling process is performed on the pre-correction target area obtained in step S5, and the post-correction target area is obtained. This result is shown in FIG. FIG. 15E shows that the same result as in the first embodiment can be obtained.
 <2.2 効果>
 本実施形態によれば、面積が所定値以上の領域を種領域として抽出し、所定値以上の面積および/または所定値以上の円形度を有する領域を補正前対象領域とする場合において、上記第1の実施形態と同様の効果が得られる。ここで、図15(A)に示す見本画像ではなく、複数の顔が描写された画像などに本実施形態における画像処理プログラムを適用することを考える。この場合、本実施形態における画像処理プログラムによれば、種領域を複数抽出でき、そして複数の補正前対象領域を抽出できる。このため、例えば複数の顔が描写された画像などから複数の顔を抽出可能である。すなわち、本実施形態は、抽出すべき対象領域が複数ある態様に好適である。
<2.2 Effect>
According to the present embodiment, in the case where a region having an area of a predetermined value or more is extracted as a seed region and a region having an area of a predetermined value or more and / or a circularity of a predetermined value or more is set as the pre-correction target region, The same effect as that of the first embodiment can be obtained. Here, it is considered that the image processing program according to the present embodiment is applied to an image in which a plurality of faces are depicted instead of the sample image shown in FIG. In this case, according to the image processing program in the present embodiment, a plurality of seed regions can be extracted, and a plurality of pre-correction target regions can be extracted. For this reason, for example, a plurality of faces can be extracted from an image in which a plurality of faces are depicted. That is, this embodiment is suitable for an aspect in which there are a plurality of target regions to be extracted.
 <3.第3の実施形態>
 <3.1 構成>
 図16は、本発明の第3の実施形態に係る画像処理装置の要部の機能的構成を示すブロック図である。図16に示すように、本画像処理装置は、上記第1の実施形態に係る画像処理装置にRGB-YCbr変換部40を加えたものである。RGB-YCbr変換部40は、CPU1によりソフトウェア的に実現される。なお、その他の構成および動作などは上記第1の実施形態と同様であるので、その説明を省略する。本実施形態に係る画像処理装置は、マルチメディアシステムから受信する画像データが示す画像から対象領域を抽出するものである。したがって、上記第1の実施形態と異なり、本実施形態では入力画像データIDは原色信号としてのRデータ、Bデータ、およびGデータからなっている。
<3. Third Embodiment>
<3.1 Configuration>
FIG. 16 is a block diagram illustrating a functional configuration of a main part of an image processing apparatus according to the third embodiment of the present invention. As shown in FIG. 16, this image processing apparatus is obtained by adding an RGB-YC b Cr conversion unit 40 to the image processing apparatus according to the first embodiment. The RGB-YC b Cr conversion unit 40 is realized by the CPU 1 as software. Since other configurations and operations are the same as those in the first embodiment, description thereof is omitted. The image processing apparatus according to the present embodiment extracts a target area from an image indicated by image data received from a multimedia system. Therefore, unlike the first embodiment, in this embodiment, the input image data ID is composed of R data, B data, and G data as primary color signals.
 画像処理装置に入力されたRデータ、Bデータ、およびGデータは、RGB-YCbr変換部40により輝度データY、第1色差データCb、および第2色差データCrに変換された後、種領域抽出部10および領域拡張部20に与えられる。ここで、RGB-YCbr変換部40における信号変換は次式(8)に基づいて行われる。
Figure JPOXMLDOC01-appb-M000007
R data input to the image processing apparatus, B data, and G data converted luminance data Y by RGB-YC b C r conversion unit 40, first color difference data C b, and the second color difference data C r Thereafter, it is given to the seed region extraction unit 10 and the region expansion unit 20. Here, the signal conversion in the RGB-YC b Cr converter 40 is performed based on the following equation (8).
Figure JPOXMLDOC01-appb-M000007
 なお、種領域抽出部10、領域拡張部20、および補正部30の動作については上記第1の実施形態と同様である。 The operations of the seed region extraction unit 10, the region expansion unit 20, and the correction unit 30 are the same as those in the first embodiment.
 <3.2 効果>
 本実施形態によれば、マルチメディアシステムから受信する画像データが示す画像から対象領域を抽出する場合において、上記第1の実施形態と同様の効果を得ることができる。
<3.2 Effects>
According to the present embodiment, when the target area is extracted from the image indicated by the image data received from the multimedia system, the same effect as in the first embodiment can be obtained.
 <4.その他>
 第1の実施形態の変形例は、上記第2の実施形態または第3の実施形態と組み合わせても良い。また、上記第3の実施形態は上記第2の実施形態と組み合わせても良い。また、上述の説明では、種領域抽出部10、領域拡張部20、補正部30、およびRGB-YCbr変換部40がソフトウェア的に実現されるものとしたが、これらの一部または全部はハードウェアにより実現されても良い。また、上記第3の実施形態では、Rデータ、Bデータ、およびGデータを輝度データY、第1色差データCb、および第2色差データCrに変換した後に、彩度rおよび色相θを求めるものとしたが、本発明はこれに限定されるものではない。例えば、Rデータ、Bデータ、およびGデータから直接、輝度Y、彩度r、および色相θを求めても良い。その他、本発明の趣旨を逸脱しない範囲で上記各実施形態を種々変形して実施することができる。
<4. Other>
The modification of the first embodiment may be combined with the second embodiment or the third embodiment. The third embodiment may be combined with the second embodiment. In the above description, the seed region extraction unit 10, the region expansion unit 20, the correction unit 30, and the RGB-YC b Cr conversion unit 40 are realized by software. May be realized by hardware. Further, in the third embodiment, R data, B data, and G data luminance data Y, first color difference data C b, and after converting the second color difference data C r, the saturation r and hue θ Although it has been determined, the present invention is not limited to this. For example, luminance Y, saturation r, and hue θ may be obtained directly from R data, B data, and G data. In addition, the above-described embodiments can be variously modified and implemented without departing from the spirit of the present invention.
 以上により、本発明によれば、画像から画素変化の小さい領域を低コストで抽出可能な画像処理装置、画像処理方法、画像処理プログラム、および画像処理プログラムを記憶した記録媒体を提供することができる。 As described above, according to the present invention, it is possible to provide an image processing apparatus, an image processing method, an image processing program, and a recording medium storing the image processing program that can extract an area with small pixel change from an image at low cost. .
 入力画像から、当該入力画像によって表現される対象物の特定部分の領域を抽出する画像処理装置、画像処理方法、画像処理プログラム、および画像処理プログラムを記憶した記録媒体に適用することができる。 The present invention can be applied to an image processing apparatus, an image processing method, an image processing program, and a recording medium storing an image processing program that extract a region of a specific part of an object represented by the input image from the input image.
1…CPU
2…入力部
3…メモリ
4…ハードディスク
5…出力部
6…画像処理プログラム
10…種領域抽出部
20…領域拡張部
30…補正部
40…RGB-YCbr変換部(信号形式変換部)
ID…入力画像データ
SD…種領域データ
EDc…補正前対象領域データ
ED…抽出データ
1 ... CPU
2 ... input unit 3 ... memory 4 ... hard disk 5 ... output section 6 ... image processing program 10 ... seed region extraction section 20 ... area expansion unit 30 ... correcting section 40 ... RGB-YC b C r conversion unit (signal format conversion portion)
ID: input image data SD: seed region data EDc: target region data ED before correction: extraction data

Claims (19)

  1.  入力画像から対象領域を抽出する画像処理装置であって、
     前記入力画像の中から、予め定められた輝度、彩度、および色相の範囲に関する条件を少なくとも満たす領域を種領域として抽出する種領域抽出部と、
     前記種領域の周辺の領域における輝度、彩度、および色相の勾配がそれぞれ輝度、彩度、および色相に関する第1閾値以下であるか否かを判定して前記勾配が前記第1閾値以下であると判定された領域を前記対象領域に含め、かつ、前記対象領域に新たに含められた領域の周辺の領域における前記勾配が前記第1閾値以下であるか否かを判定して前記勾配が前記第1閾値以下であると判定された領域を含めることにより、前記勾配が前記第1閾値以下であると判定された領域および前記種領域を前記対象領域として取得する領域拡張部とを備えることを特徴とする、画像処理装置。
    An image processing apparatus that extracts a target area from an input image,
    A seed region extraction unit that extracts, as a seed region, a region that satisfies at least conditions relating to a predetermined range of luminance, saturation, and hue from the input image;
    It is determined whether or not the gradients of luminance, saturation, and hue in the peripheral region of the seed region are less than or equal to a first threshold for luminance, saturation, and hue, respectively, and the gradient is less than or equal to the first threshold. The region determined to be included in the target region and whether or not the gradient in the region around the region newly included in the target region is equal to or less than the first threshold value is determined. Including an area determined to be equal to or less than a first threshold, and an area expansion unit that acquires the area where the gradient is equal to or less than the first threshold and the seed area as the target area. An image processing apparatus as a feature.
  2.  前記領域拡張部は、前記勾配が第1閾値以下であるか否かの判定を、前記種領域中の各画素を起点として行うことを特徴とする、請求項1に記載の画像処理装置。 2. The image processing apparatus according to claim 1, wherein the area expanding unit determines whether or not the gradient is equal to or less than a first threshold from each pixel in the seed area.
  3.  前記領域拡張部は、
      前記種領域中の各画素を注目画素として、当該画素の周辺の画素における前記勾配が前記第1閾値以下である否かを判定し、判定結果が前記第1閾値以下であれば判定対象の画素を前記対象領域に含める第1の拡張処理と、
      新たに前記対象領域に含められた画素を注目画素として、当該画素の周辺の画素における前記勾配が前記第1閾値以下である否かを判定し、判定結果が前記第1閾値以下であれば判定対象の画素を前記対象領域に含めることを繰り返す第2の拡張処理とを行う特徴とする、請求項2に記載の画像処理装置。
    The area extension is
    Using each pixel in the seed region as a pixel of interest, it is determined whether or not the gradient in the surrounding pixels of the pixel is equal to or less than the first threshold value. If the determination result is equal to or less than the first threshold value, the pixel to be determined A first expansion process for including
    A pixel newly included in the target region is set as a pixel of interest, and it is determined whether or not the gradient of pixels around the pixel is equal to or less than the first threshold. If the determination result is equal to or less than the first threshold, the determination is made. The image processing apparatus according to claim 2, wherein a second extension process that repeats including a target pixel in the target area is performed.
  4.  前記種領域抽出部は、前記勾配が所定値以下である条件をさらに満たす領域を前記種領域して抽出することを特徴とする、請求項1から3までのいずれか1項に記載の画像処理装置。 The image processing according to any one of claims 1 to 3, wherein the seed region extraction unit extracts, as the seed region, a region that further satisfies a condition that the gradient is equal to or less than a predetermined value. apparatus.
  5.  前記所定値は、前記第1閾値よりも小さい第2閾値であることを特徴とする、請求項4に記載の画像処理装置。 The image processing apparatus according to claim 4, wherein the predetermined value is a second threshold value that is smaller than the first threshold value.
  6.  前記種領域抽出部は、前記輝度、彩度、および色相の範囲に関する条件を満たす領域が複数ある場合に、当該複数の領域のうちの、面積に関する第1の所定の条件を満たす領域を前記種領域として抽出することを特徴とする、請求項1から3までのいずれか1項に記載の画像処理装置。 When there are a plurality of regions that satisfy the conditions regarding the luminance, saturation, and hue ranges, the seed region extraction unit selects a region that satisfies a first predetermined condition regarding the area from the plurality of regions. The image processing apparatus according to claim 1, wherein the image processing apparatus is extracted as a region.
  7.  前記面積に関する第1の所定の条件は、前記輝度、彩度、および色相の範囲に関する条件を満たす複数の領域のうちで面積が最大であるという条件であることを特徴とする、請求項6に記載の画像処理装置。 The first predetermined condition relating to the area is a condition that the area is a maximum among a plurality of regions that satisfy the conditions relating to the luminance, saturation, and hue ranges. The image processing apparatus described.
  8.  前記面積に関する第1の所定の条件は、面積が所定値以上であるという条件であることを特徴とする、請求項6に記載の画像処理装置。 The image processing apparatus according to claim 6, wherein the first predetermined condition relating to the area is a condition that the area is equal to or greater than a predetermined value.
  9.  前記領域拡張部は、前記勾配が前記第1閾値以下であると判定された領域および前記種領域からそれぞれがなる複数の領域が得られた場合に、当該複数の領域のうちの、面積に関する第2の所定の条件を満たす領域を抽出すべき対象領域とすることを特徴とする、請求項8に記載の画像処理装置。 When the region expansion unit obtains a plurality of regions each composed of the region determined to have the gradient equal to or less than the first threshold and the seed region, the region expansion unit The image processing apparatus according to claim 8, wherein an area that satisfies the predetermined condition of 2 is a target area to be extracted.
  10.  前記面積に関する第2の所定の条件は、前記複数の領域のうちで面積が最大であるという条件であることを特徴とする、請求項9に記載の画像処理装置。 10. The image processing apparatus according to claim 9, wherein the second predetermined condition relating to the area is a condition that the area is the maximum among the plurality of regions.
  11.  前記領域拡張部が取得した前記対象領域に対して所定の補正処理を行う補正部をさらに備えることを特徴とする、請求項1から3までのいずれか1項に記載の画像処理装置。 4. The image processing apparatus according to claim 1, further comprising a correction unit that performs a predetermined correction process on the target area acquired by the area expansion unit.
  12.  前記所定の補正処理は、前記領域拡張部が取得した前記対象領域の内周に接する当該対象領域ではない領域のうちの、面積が所定値以下の領域を当該対象領域に含める処理であることを特徴とする、請求項11に記載の画像処理装置。 The predetermined correction process is a process of including, in the target area, an area whose area is equal to or less than a predetermined value among the areas that are not the target area in contact with the inner periphery of the target area acquired by the area expanding unit. The image processing apparatus according to claim 11, wherein the image processing apparatus is characterized.
  13.  前記入力画像は、輝度信号および色差信号で示されることを特徴とする、請求項1から3までのいずれか1項に記載の画像処理装置。 The image processing apparatus according to any one of claims 1 to 3, wherein the input image is represented by a luminance signal and a color difference signal.
  14.  原色信号で示される入力画像を、輝度信号および色差信号で示される前記入力画像に変換する信号形式変換部をさらに備えることを特徴とする、請求項13に記載の画像処理装置。 The image processing apparatus according to claim 13, further comprising a signal format conversion unit that converts an input image indicated by a primary color signal into the input image indicated by a luminance signal and a color difference signal.
  15.  入力画像から対象領域を抽出する画像処理方法であって、
     前記入力画像の中から、予め定められた輝度、彩度、および色相の範囲に関する条件を少なくとも満たす領域を種領域として抽出する種領域抽出ステップと、
     前記種領域の周辺の領域における輝度、彩度、および色相の勾配がそれぞれ輝度、彩度、および色相に関する第1閾値以下であるか否かを判定して前記勾配が前記第1閾値以下であると判定された領域を前記対象領域に含め、かつ、前記対象領域に新たに含められた領域の周辺の領域における前記勾配が前記第1閾値以下であるか否かを判定して前記勾配が前記第1閾値以下であると判定された領域を含めることにより、前記勾配が前記第1閾値以下であると判定された領域および前記種領域を前記対象領域として取得する領域拡張ステップとを備えることを特徴とする、画像処理方法。
    An image processing method for extracting a target area from an input image,
    A seed region extraction step for extracting, from the input image, a region that satisfies at least the conditions relating to the predetermined luminance, saturation, and hue range as a seed region;
    It is determined whether or not the gradients of luminance, saturation, and hue in the peripheral region of the seed region are less than or equal to a first threshold for luminance, saturation, and hue, respectively, and the gradient is less than or equal to the first threshold. The region determined to be included in the target region and whether or not the gradient in the region around the region newly included in the target region is equal to or less than the first threshold value is determined. Including an area determined to be equal to or lower than a first threshold, and an area expansion step for acquiring the area determined to be equal to or lower than the first threshold and the seed area as the target area. A characteristic image processing method.
  16.  前記領域拡張ステップでは、前記勾配が第1閾値以下であるか否かの判定は、前記種領域中の各画素を起点として行われることを特徴とする、請求項15に記載の画像処理方法。 16. The image processing method according to claim 15, wherein, in the region expansion step, the determination as to whether or not the gradient is equal to or less than a first threshold is performed starting from each pixel in the seed region.
  17.  前記領域拡張ステップは、
      前記種領域中の各画素を注目画素として、当該画素の周辺の画素における前記勾配が前記第1閾値以下である否かを判定し、判定結果が前記第1閾値以下であれば判定対象の画素を前記対象領域に含める第1の拡張ステップと、
      新たに前記対象領域に含められた画素を注目画素として、当該画素の周辺の画素における前記勾配が前記第1閾値以下である否かを判定し、判定結果が前記第1閾値以下であれば判定対象の画素を前記対象領域に含めることを繰り返す第2の拡張ステップとを含むことを特徴とする、請求項16に記載の画像処理方法。
    The region expansion step includes
    Using each pixel in the seed region as a pixel of interest, it is determined whether or not the gradient in the surrounding pixels of the pixel is equal to or less than the first threshold value. If the determination result is equal to or less than the first threshold value, the pixel to be determined A first expansion step of including in the region of interest;
    A pixel newly included in the target region is set as a pixel of interest, and it is determined whether or not the gradient of pixels around the pixel is equal to or less than the first threshold. If the determination result is equal to or less than the first threshold, the determination is made. The image processing method according to claim 16, further comprising a second extension step of repeatedly including a target pixel in the target region.
  18.  請求項15から17までのいずれか1項に記載の画像処理方法における各ステップをコンピュータに実行させることを特徴とする、画像処理プログラム。 An image processing program causing a computer to execute each step in the image processing method according to any one of claims 15 to 17.
  19.  請求項18に記載の画像処理プログラムを記録したことを特徴とする、コンピュータ読み取り可能な記録媒体。 A computer-readable recording medium on which the image processing program according to claim 18 is recorded.
PCT/JP2012/081888 2011-12-14 2012-12-10 Image processing device, image processing method, image processing program, and recording medium storing image processing program WO2013089051A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2011-272978 2011-12-14
JP2011272978 2011-12-14

Publications (1)

Publication Number Publication Date
WO2013089051A1 true WO2013089051A1 (en) 2013-06-20

Family

ID=48612499

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2012/081888 WO2013089051A1 (en) 2011-12-14 2012-12-10 Image processing device, image processing method, image processing program, and recording medium storing image processing program

Country Status (1)

Country Link
WO (1) WO2013089051A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104378619A (en) * 2014-11-12 2015-02-25 合肥工业大学 Rapid and efficient hole filling algorithm based on foreground and background gradient transition

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006039666A (en) * 2004-07-22 2006-02-09 Konica Minolta Photo Imaging Inc Image processing method, image processor and image processing program
JP2007096379A (en) * 2005-09-27 2007-04-12 Casio Comput Co Ltd Imaging apparatus, image recording and retrieving apparatus and program
JP2007318564A (en) * 2006-05-26 2007-12-06 Canon Inc Image processing method and image processing apparatus
JP2010033221A (en) * 2008-07-28 2010-02-12 Fujifilm Corp Skin color detection apparatus, method, and program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006039666A (en) * 2004-07-22 2006-02-09 Konica Minolta Photo Imaging Inc Image processing method, image processor and image processing program
JP2007096379A (en) * 2005-09-27 2007-04-12 Casio Comput Co Ltd Imaging apparatus, image recording and retrieving apparatus and program
JP2007318564A (en) * 2006-05-26 2007-12-06 Canon Inc Image processing method and image processing apparatus
JP2010033221A (en) * 2008-07-28 2010-02-12 Fujifilm Corp Skin color detection apparatus, method, and program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104378619A (en) * 2014-11-12 2015-02-25 合肥工业大学 Rapid and efficient hole filling algorithm based on foreground and background gradient transition

Similar Documents

Publication Publication Date Title
JP5116393B2 (en) Image processing apparatus and image processing method
JP4375322B2 (en) Image processing apparatus, image processing method, program thereof, and computer-readable recording medium recording the program
JP5744429B2 (en) Image processing apparatus, image processing method, and program
US8149293B2 (en) Image processing apparatus, imaging apparatus, image processing method and program recording medium
JP2015197745A (en) Image processing apparatus, imaging apparatus, image processing method, and program
JP6477369B2 (en) Information embedding device, information embedding method, and information embedding program
JP2013232881A (en) Image processing device and control method thereof
JP2007096437A (en) Determination of image creator&#39;s intention
US10158790B2 (en) Image processing apparatus, image processing system, and image processing method
CN111861893A (en) Method, system, equipment and computer medium for eliminating false color edge of image
US9323981B2 (en) Face component extraction apparatus, face component extraction method and recording medium in which program for face component extraction method is stored
WO2013161407A1 (en) Object detection device and program
WO2012153661A1 (en) Image correction device, image correction display device, image correction method, program, and recording medium
WO2013089051A1 (en) Image processing device, image processing method, image processing program, and recording medium storing image processing program
JP2009200635A (en) Image processor, and processing method and program
JP6415094B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
JP6140478B2 (en) Object detection device, program, and integrated circuit
WO2013161417A1 (en) Object detection device and program
JP6957665B2 (en) Image processing equipment, image processing methods and programs
JP5245991B2 (en) BRIGHTNESS CORRECTION PROGRAM, BRIGHTNESS CORRECTION METHOD, AND BRIGHTNESS CORRECTION DEVICE
WO2012099013A1 (en) Image correction device, image correction display device, image correction method, program, and recording medium
JP5903315B2 (en) Image processing apparatus and image processing program
JP6413210B2 (en) Image processing apparatus, imaging apparatus, and program
JP5883715B2 (en) Image processing LSI, image processing system, and image processing method
JP2002152762A (en) Image processing apparatus and recording medium with image processing program recorded thereon

Legal Events

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

Ref document number: 12857259

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12857259

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP