1. Field of the Invention
The present invention relates to an image processing apparatus for detecting shadows within photographic images, and to an image processing apparatus for removing shadows, which are detected within photographic images.
2. Description of the Related Art
Processes for removing shadows from photographic images are necessary in various fields. For example, in the field of ID photographs, there are no problems in the case that an ID photograph is photographed at a photography studio, in which equipment such as illumination equipment, are provided. However, in the case that a simple apparatus is employed to photograph an ID photograph, shadows may appear on a background, in the vicinity of a subject, which is a foreground object (an upper body of a human including the face, in the case of an ID photograph). It is necessary to remove the shadows if photographic images obtained in this manner are to be utilized as ID photographs.
Japanese Unexamined Patent Publication Nos. 7(1995)-220049 and 2001-209809 disclose techniques for removing shadows from photographic images. Japanese Unexamined Patent Publication No. 7 (1995)-220049 discloses a technique in which logic operations are administered on a background image, that is, an image obtained by photographing a background without a foreground object, and an image with a foreground object. Thereby, a region in which the shadow of a main subject appears on the background is detected and removed. Japanese Unexamined Patent Publication No. 2001-209809 discloses a technique in which a difference image is obtained between a background image (an image without a foreground object) and an image with a foreground object. A shadow region is estimated from within the difference image and removed.
Both of the above techniques require the background image, that is, the image obtained by photographing the background without the foreground object. Therefore, it is necessary to perform photography twice in order to remove shadows from photographic images, which is time consuming and troublesome. Consider a case in which a company, which has offices scattered throughout the country issues photo ID cards for its employees. The locations at where photography is performed (photography points) and the location at which the ID cards are actually generated (card issuing center) may be different. A system may be employed, in which photographic images may be obtained by performing photography at a plurality of photography points then sent to the card issuing center, and cards are generated at the card issuing center by employing the photographic images. In this case, it is difficult to obtain background images of all of the photography points, and if the background images are not obtained, then shadows cannot be removed from the photographic images.
The present invention have been developed in view of the foregoing circumstances, and it is an object of the present invention to provide an image processing apparatus which is capable of detecting and removing shadows from photographic images without requiring background images.
A first image processing apparatus of the present invention is an image processing apparatus for removing shadows of a main subject, from a photographic image in which the shadows are present within a background having a simple pattern, comprising:
shadowless background region extracting means for extracting a shadowless background region, in which the shadows are not present, from the photographic image;
shadow region extracting means for extracting a shadow region, from regions within the photographic image other than the shadowless background region; and
correcting means, for removing the shadows from the photographic image, by adjusting pixel values of the shadowless background region and/or the shadow region.
The “photographic image” in the present invention refers to a photographic image of the main subject in front of a background having a simple pattern. The photographic image is not limited to that obtained by photography with a digital camera, and may include those obtained by reading out photographic film or prints with a readout apparatus, such as a scanner.
The “shadows” in the present invention refers to shadows of the main subject, which are present within the background, which excludes the main subject. For example in the case of the photographic image illustrated in
The first image processing apparatus of the present invention first extracts a shadowless background region, such as Region A of
Generally, in illuminated photographic images in which subjects are pictured from the shoulders up, the shadow regions and the shadowless background regions are adjacent to each other. However, there are cases in which the shadow regions and the shadowless background regions are not adjacent to each other. For example, if a photographic image is obtained by photographing a person who has placed a hand at their waist, a background region is formed within the loop formed by the person's arm and their body. In this photographic image, there are cases that the shadow region is formed within the loop, due to lighting conditions and the like. In these cases, the shadow region within the loop and the shadowless background region outside the loop sandwich the subject's arm, and therefore are not adjacent to each other. The “shadow region extracting means” of the image processing apparatus of the present invention may be configured to be able to extract shadow regions in special cases such as these. However, it is preferable to extract the shadow regions from regions adjacent to the shadowless background region, in order to accurately and expediently extract the shadow regions, particularly from illuminated photographic images.
Here, the “shadowless background region extracting means” may comprise: local region obtaining means for obtaining a local region within the shadowless background region. In this case, the shadowless background region is extracted by obtaining regions adjacent to the obtained local region having pixels of similar colors to that of the local region, and by combining the local region with the adjacent regions.
The “local region” refers to a portion of the shadowless background region. In the case that the background is monochromatic or has no pattern therein, a single pixel will suffice as the local region. However, in the case that the background is a simple pattern, such as wood grain, polka dots, or a lattice, it is desirable that the local region includes at least a single pattern therein.
The phrase “having pixels of similar colors” refers to a state in which the pixels are at distances less than or equal to a predetermined threshold value within a chromaticity diagram, from pixels of the local region. For example, pixels having substantially the same chromaticity, saturation, and brightness, or pixels having substantially the same R, G, and B values, are considered to be pixels having similar colors.
The phrase “regions . . . having pixels of similar colors to that of the local region” refers to regions constituted by pixels having colors similar to pixels within the local region. For example, in the case that the local region is constituted by a single pixel, the regions may be those constituted by pixels having substantially the same pixel values (hue, saturation, brightness, or R, G, and B values) as the pixel of the local region. On the other hand, in the case that the local region is constituted by a plurality of pixels, average pixel values of the plurality of pixels that constitute the local region may be employed as a reference. In this case, the regions are those constituted by pixels, the differences in pixel values thereof from the reference values being within a predetermined threshold value. Average pixel values may be obtained for each pixel block, constituted by a plurality of pixels, and the regions determined to be those constituted by pixel blocks having substantially the same average pixel values as that of the local region.
A second image processing apparatus of the present invention is an image processing apparatus for removing shadows of a main subject, from a photographic image in which the shadows are present within a background having a simple pattern, comprising:
background region extracting means for extracting a background region, in which the shadows are present, from the photographic image;
shadow region extracting means for separating the extracted background region with shadows therein into a shadowless background region without shadows therein and a shadow region, in which the shadows are present; and
correcting means, for removing the shadows from the photographic image, by adjusting pixel values of the shadowless background region and/or the shadow region.
That is, the first image processing apparatus of the present invention extracts the shadowless background region (Region A, in the example illustrated in
In the second image processing apparatus of the present invention, the background extracting means may comprise local region obtaining means for obtaining a local region within a shadowless portion of the background region. In this case, the background region is extracted by obtaining regions adjacent to the obtained local region having pixels of similar colors to that of the local region, and by combining the local region with the adjacent regions.
Here, the “local region” is the same as that which has been described previously.
In backgrounds having simple patterns, the hue and/or the saturation among pixels are substantially the same regardless of whether the pixels are within shadow regions or shadowless regions. The second image processing apparatus of the present invention takes advantage of this point, and obtains regions of pixels having substantially the same hue and/or saturation as the local region (including the local region) as the background region. That is, the entire background region that excludes the foreground object, which is the main subject, is first extracted in this manner.
It is desirable that regions of pixels having substantially the same hue and saturation as those of the local region are obtained during extraction of the shadow region. If this configuration is adopted, backgrounds of various colors can be dealt with. However, in cases that the color of the background is known, then either the hue or the saturation only may be employed. For example, in the case that the background is gray, only the saturation may be employed to extract a shadow region constituted by pixels having substantially the same saturation value as that of pixels within the local region.
The local region obtaining means of the first and second image processing apparatuses of the present invention may be any means that is capable of obtaining a portion of the shadowless background region. For example the local region obtaining means may comprise face detecting means, in the case that the photographic image is an ID photo of a person. In this case, the local region can be obtained based on a facial region detected by the face detecting means.
In the case of ID photos, it is rare that shadows are formed above the central portion of a person's face. Therefore, the facial region may be detected by the face detecting means, and a portion of the photographic image above the central portion of the facial region, excluding the facial region, may be designated as the local region. Alternatively, a portion of the photographic image above the detected facial region may be designated as the local region.
Alternatively, the local region obtaining means may comprise input means, for specifying the local region. In this case, the local region may be obtained based on input, which is input via the input means.
The shadow region extracting means of the first image processing apparatus of the present invention extracts the shadow region from regions other than the shadowless background region. In contrast, the second image processing apparatus of the present invention extracts the shadow region, by separating the background region into the shadowless background region and the shadow region. Specifically, pixels of the shadowless background region and pixels of the shadow region have substantially the same hue and/or saturation values. However, the brightness of the pixels within the shadow region is lower than that of the pixels within the shadowless background region. Utilizing this fact, a region that has substantially the same hue and/or saturation and a lower brightness than the shadowless background region can be extracted as the shadow region.
The correcting means of the image processing apparatuses of the present invention removes shadows by adjusting the pixel values of pixels within the shadowless background region and/or the shadow region. Pixel values of both the shadowless background region and the shadow region, or pixel values of either one of the two regions can be adjusted, as long as the pixel values of the shadowless background region and the pixel values of the shadow region are matched. For example, the brightness of the pixels within the shadow region may be adjusted to match that of the shadowless background region, the brightness of the pixels within both the shadow region and the shadowless background region may be adjusted to be a predetermined brightness, or the brightness of the pixels within the shadowless background region may be adjusted to match that of the shadow region.
The methods of extracting shadow regions by the image processing apparatuses of the present invention is not limited to applications in which shadow regions are to be removed from photographic images, and may be applied to any purpose in which extraction of shadow regions is necessary. For example, in the field of specifying photography times from photographic images, the photography time can be specified by extracting the shadow region from a photographic image having a building, of which the position and the like are known, as the background.
The image processing apparatuses of the present invention may be provided as programs that cause a computer to execute the procedures performed thereby. That is, programs may be provided that cause a computer to function as the image processes apparatuses of the present invention.
Note that the program of the present invention may be provided being recorded on a computer readable medium. Those who are skilled in the art would know that computer readable media are not limited to any specific type of device, and include, but are not limited to: floppy disks, CD's, RAM's, ROM's, hard disks, magnetic tapes, and internet downloads, in which computer instructions can be stored and/or transmitted. Transmission of the computer instructions through a network or through wireless transmission means is also within the scope of this invention. Additionally, computer instructions include, but are not limited to: source, object, and executable code, and can be in any language, including higher level languages, assembly language, and machine language.
The first image processing apparatus of the present invention extracts the shadowless background region from a photographic image, extracts the shadow region based on the shadowless background region, and removes the shadow from the photographic image. The second image processing apparatus of the present invention extracts the background region from a photographic image, extracts the shadow region by separating the background into the shadowless background region and the shadow region, and removes the shadow from the photographic image. Accordingly, shadows can be removed from photographic images without a background image, in which only the background is pictured.
Hereinafter, an embodiment of the present invention will be described with reference to the attached drawings.
As illustrated in
As illustrated in
The characteristic amount calculating section 110 of the face detecting section 100 calculates the characteristic amounts C0, which are employed to discriminate faces, from the facial images S0. Specifically, gradient vectors (the direction and magnitude of density change at each pixel within the facial images S0) are calculated as the characteristic amounts C0. Hereinafter, calculation of the gradient vectors will be described. First, the characteristic amount calculating section 110 detects edges in the horizontal direction within a facial image S0, by administering a filtering process with a horizontal edge detecting filter, as illustrated in
In the case of a human face, such as that illustrated in
The directions and magnitudes of the gradient vectors K are designated as the characteristic amounts C0. Note that the directions of the gradient vectors K are values between 0 and 359, representing the angle of the gradient vectors K from a predetermined direction (the x-direction in
Here, the magnitudes of the gradient vectors K are normalized. The normalization is performed in the following manner. First, a histogram that represents the magnitudes of the gradient vectors K of all of the pixels within the facial image S0 is derived. Then, the magnitudes of the gradient vectors K are corrected, by flattening the histogram so that the distribution of the magnitudes is evenly distributed across the range of values assumable by each pixel of the candidate image (0 through 255 in the case that the image data is 8 bit data). For example, in the case that the magnitudes of the gradient vectors K are small and concentrated at the low value side of the histogram, as illustrated in
The reference data sets H0, which are stored in the database 115, defines discrimination conditions for combinations of the characteristic amounts C0 for each pixel of each of a plurality of types of pixel groups, which are constituted by a plurality of pixels selected from sample images, to be described later.
The combinations of the characteristic amounts C0 and the discrimination conditions within the reference data sets H0 are set in advance by learning. The learning is performed by employing a sample image group comprising a plurality of sample images, which are known to be of faces, and a plurality of sample images, which are known to not be of faces.
Note that in the present embodiment, the sample images, which are known to be of faces and are utilized to generate the reference data sets H0, have the following specifications. That is, the sample images are of a 30×30 pixel size, the distances between the centers of the eyes of each face within the images are one of 9, 10, or 11 pixels, and the faces are rotated stepwise in three degree increments within a range of ±15 degrees from the vertical (that is, the rotational angles are −15 degrees, −12 degrees, −9 degrees, −6 degrees, 0 degrees, 3 degrees, 6 degrees, 9 degrees, 12 degrees, and 15 degrees). Accordingly, 33 sample images (3×11) are prepared for each face. Note that only sample images which are rotated −15 degrees, 0 degrees, and 15 degrees are illustrated in
Arbitrary images of a 30×30 pixel size are employed as the sample images which are known to not be of faces.
Consider a case in which sample images, in which the distance between the eyes are 10 pixels and the rotational angle is 0 degrees (that is, the faces are in the vertical orientation), are employed exclusively to perform learning. In this case, only those faces, in which the distance between the eyes are 10 pixels and which are not rotated at all, would be discriminated by referring to the reference data sets H0. The sizes of the faces, which are possibly included in the facial images S0, are not uniform in size. Therefore, during discrimination regarding whether a face is included in the photograph, the facial image S0 is enlarged/reduced, to enable discrimination of a face of a size that matches that of the sample images. However, in order to maintain the distance between the centers of the eyes accurately at ten pixels, it is necessary to enlarge and reduce the facial image S0 in a stepwise manner with magnification rates in 1.1 units, thereby causing the amount of calculations to be great.
In addition, faces, which are possibly included in the facial images S0, are not only those which have rotational angles of 0 degrees, as that illustrated in
For these reasons, the present embodiment imparts an allowable range to the reference data sets H0. This is accomplished by employing sample images, which are known to be of faces, in which the distances between the centers of the eyes are 9, 10, and 11 pixels, and which are rotated in a stepwise manner in three degree increments within a range of +15 degrees. Thereby, the facial image S0 may be enlarged/reduced in a stepwise manner with magnification rates in 11/9 units, which enables reduction of the time required for calculations, compared to a case in which the facial image S0 is enlarged/reduced with magnification rates in 1.1 units. In addition, rotated faces, such as those illustrated in
Hereinafter, an example of a learning technique employing the sample images will be described with reference to the flow chart of
The sample images, which are the subject of learning, comprise a plurality of sample images, which are known to be of faces, and a plurality of sample images, which are known to not be of faces. Note that the in sample images, which are known to be of faces, the distances between the centers of the eyes of each face within the images are one of 9, 10, or 11 pixels, and the faces are rotated stepwise in three degree increments within a range of ±15 degrees from the vertical. Each sample image is weighted, that is, is assigned a level of importance. First, the initial values of weighting of all of the sample images are set equally to 1 (step S1).
Next, discriminators are generated for each of the different types of pixel groups of the sample images (step S2). Here, each discriminator has a function of providing a reference to discriminate images of faces from those not of faces, by employing combinations of the characteristic amounts C0, for each pixel that constitutes a single pixel group. In the present embodiment, histograms of combinations of the characteristic amounts C0 for each pixel that constitutes a single pixel group are utilized as the discriminators.
The generation of a discriminator will be described with reference to
Value of Combination=0 (in the case that the magnitude of the gradient vector is 0); and
Value of Combination=(direction of the gradient vector+1)×magnitude of the gradient vector (in the case that the magnitude of the gradient vector>0).
Due to the above quaternarization and ternarization, the possible number of combinations becomes 94, thereby reducing the amount of data of the characteristic amounts C0.
In a similar manner, histograms are generated for the plurality of sample images, which are known to not be of faces. Note that in the sample images, which are known to not be of faces, pixels (denoted by the same reference numerals P1 through P4) at positions corresponding to the pixels P1 through P4 of the sample images, which are known to be of faces, are employed in the calculation of the characteristic amounts C0. Logarithms of the ratios of the frequencies in the two histograms are represented by the rightmost histogram illustrated in
Thereafter, a discriminator, which is most effective in discriminating whether an image is of a face, is selected from the plurality of discriminators generated in step S2. The selection of the most effective discriminator is performed while taking the weighting of each sample image into consideration. In this example, the percentages of correct discriminations provided by each of the discriminators are compared, and the discriminator having the highest weighted percentage of correct discriminations is selected (step S3). At the first step S3, all of the weighting of the sample images are equal, at 1. Therefore, the discriminator that correctly discriminates whether sample images are of faces with the highest frequency is selected as the most effective discriminator. On the other hand, the weightings of each of the sample images are renewed at step S5, to be described later. Thereafter, the process returns to step S3. Therefore, at the second step S3, there are sample images weighted with 1, those weighted with a value less than 1, and those weighted with a value greater than 1. Accordingly, during evaluation of the percentage of correct discriminations, a sample image, which has a weighting greater than 1, is counted more than a sample image, which has a weighting of 1. For these reasons, from the second and subsequent step S3's, more importance is placed on correctly discriminating heavily weighted sample images than lightly weighted sample images.
Next, confirmation is made regarding whether the percentage of correct discriminations of a combination of the discriminators which have been selected exceeds a predetermined threshold value (step S4). That is, the percentage of discrimination results regarding whether sample images are of faces, which are obtained by the combination of the selected discriminators, that match the actual sample images is compared against the predetermined threshold value. Here, the sample images, which are employed in the evaluation of the percentage of correct discriminations, may be those that are weighted with different values, or those that are equally weighted. In case that the percentage of correct discriminations exceeds the predetermined threshold value, whether an image is of a face can be discriminated by the selected discriminators with sufficiently high accuracy, therefore the learning process is completed. In the case that the percentage of correct discriminations is less than or equal to the predetermined threshold value, the process proceeds to step S6, to select an additional discriminator, to be employed in combination with the discriminators which have been selected thus far.
The discriminator, which has been selected at the immediately preceding step S3, is excluded from selection in step S6, so that it is not selected again.
Next, the weighting of sample images, which were not correctly discriminated by the discriminator selected at the immediately preceding step S3, is increased, and the weighting of sample images, which were correctly discriminated, is decreased (step S5). The reason for increasing and decreasing the weighting in this manner is to place more importance on images which were not correctly discriminated by the discriminators that have been selected thus far. In this manner, selection of a discriminator which is capable of correctly discriminating whether these sample images are of a face is encouraged, thereby improving the effect of the combination of discriminators.
Thereafter, the process returns to step S3, and another effective discriminator is selected, using the weighted percentages of correct discriminations as a reference.
The above steps S3 through S6 are repeated to select discriminators corresponding to combinations of the characteristic amounts C0 for each pixel that constitutes specific pixel groups, which are suited for discriminating whether faces are included in images. If the percentages of correct discriminations, which are evaluated at step S4, exceed the threshold value, the type of discriminator and discrimination conditions, which are to be employed in discrimination regarding whether images include faces, are determined (step S7), and the learning of the reference data sets H0 is completed.
Note that in the case that the learning technique described above is applied, the discriminators are not limited to those in the histogram format. The discriminators may be of any format, as long as they provide references to discriminate between images of faces and other images by employing combinations of the first characteristic amounts E1 of each pixel that constitutes specific pixel groups. Examples of alternative discriminators are: binary data, threshold values, functions, and the like. As a further alternative, a histogram that represents the distribution of difference values between the two histograms illustrated in the center of
The learning technique is not limited to that which has been described above. Other machine learning techniques, such as a neural network technique, may be employed.
The detection executing section 120 refers to the discrimination conditions of the reference data sets H0, which has been learned regarding every combination of the characteristic amounts C0 of each pixel that constitutes a plurality of types of pixel groups. Thereby, the discrimination points of the combinations of the characteristic amounts C0 of each pixel that constitutes each of the pixel groups are obtained. A face is detected from the facial image S0 by totaling the discrimination points. At this time, of the characteristic amounts C0, the directions of the gradient vectors K are quaternarized, and the magnitudes of the gradient vectors K are ternarized. In the present embodiment, detection is performed based on the magnitude of the sum of all of the discrimination points, and whether the sum is positive or negative. For example, in the case that the total sum of the discrimination points is positive, it is judged that a face is included in the facial image S0. In the case that the total sum of the discrimination points is negative, it is judged that a face is not included in the facial image S0.
Here, the sizes of the facial images S0 are varied, unlike the sample images, which are 30×30 pixels. In addition, in the case that a face is included in the facial image S0, the face is not necessarily in the vertical orientation. For these reasons, the detection executing section 120 enlarges/reduces the facial image S0 in a stepwise manner (
Note that during learning of the reference data sets H0, sample images are utilized, in which the distances between the centers of the eyes are one of 9, 10, and 11 pixels. Therefore, the magnification rate during enlargement/reduction of the facial image S0 may be set to be 11/9. In addition, during learning of the reference data sets H0, sample images are utilized, in which faces are rotated within a range of ±15 degrees. Therefore, the facial image S0 and the candidate may be rotated over 360 degrees in 30 degree increments.
Here, the characteristic amount calculating section 110 calculates the characteristic amounts C0 from the facial image S0 at each step of their stepwise enlargement/reduction and rotational deformation.
The face detecting section 100 of the shadow detecting section 80a obtains the facial data H1 that indicates the position and the size of a face within a facial image S0 in this manner.
The local region determining section 125a determines a portion of the shadowless background region within the facial image S0, based on the facial data H1. Specifically, advantage is taken of the fact that shadows are rarely formed above the face of a person who is the main subject, in the case of an ID photo. An arbitrary position (a point or a predetermined range) above the face is determined to be the local region, based on the position and the range (size) of the face indicated by the facial data H1. Note that in the case of ID photos, it is also rare for shadows to be formed above the central portion of the person's face. Therefore, an arbitrary position above the central portion of the face and excluding the facial region may be determined to be the local region. In the present embodiment, the local region determining section 125a determines the entire portion of the facial image S0 above the face to be the local region.
The extraction executing section 130a extracts the shadowless background region Wa based on the local region obtained by the local region determining section 125a. Specifically, first, the average color of pixels within the local region is calculated. In the present embodiment, an average hue, an average saturation, and an average brightness of the pixels within the local region are calculated. Next, the extraction executing section 130a detects regions adjacent to the local region and constituted by pixels, of which: the differences in the hue, the saturation, and the brightness from the average hue, the average saturation, and the average brightness of the local region are within predetermined threshold values, from regions of the facial image S0 other than the local region and the facial region. The detected regions and the local region are combined to extract the shadowless background region Wa. In the example illustrated in
The extraction executing section 130a outputs data indicating the shadowlesss background region Wa, data that indicates the positional range of the region Wa in this case, to the shadow region extracting section 140a. The shadow region extracting section 140a detects a region adjacent to the shadowless background region and constituted by pixels, of which: the differences in the hue and the saturation from the average hue and the average saturation of the local region are within predetermined threshold values; the brightness is lower than the average brightness of the local region; and the difference in the brightness from the average brightness of the local region is greater than a predetermined threshold value. The detected region is extracted as the shadow region KS.
The correcting section 54 administers processes for removing shadows from the facial image S0. Specifically, the correcting section 54 adjusts the brightness of the pixels within the shadow region KS such that they match the average brightness of the pixels within the local region. A corrected image S1 is obtained by correcting the brightness of each pixel within the shadow region KS in this manner.
Note that here, the correcting section 54 may obtain the average brightness of the pixels within the shadowless background region Wa, and adjust the brightness of each pixel within the shadow region KS to match the obtained average brightness. Alternatively, the brightness of each pixel within the shadowless background region Wa may be adjusted to match the brightness (average brightness) of pixels within the shadow region KS. As a further alternative, the brightness of each pixel in both the shadowless background region Wa and the shadow region KS may be adjusted to assume a uniform predetermined value.
As illustrated in
The input section 125b enables a user to specify a “portion of the background at which shadows are not present”, that is, a local region, from within a facial image S0. The input section 125b comprises: a monitor for displaying the facial image S0; and a mouse or the like, for specifying the local region within an image (the facial image S0) displayed on the monitor. For example, the user may specify a local region indicated by Q0 in
In the present embodiment, the input section 125b enables the user to specify a single local region. An example will be described for a case in which Region Q0 has been specified as the local region.
The extraction executing section 130b first calculates an average hue and an average saturation of pixels within Region Q0. Next, the extraction executing section 130b detects regions adjacent to Region Q0 and constituted by pixels, of which: the differences in the hue and the saturation from the average hue and the average saturation of Region Q0 are within predetermined threshold values. The detected regions and Region Q0 are combined to extract the background region Wb. In the examples illustrated in
The shadow region extracting section 140b extracts a shadow region KS, by separating the shadow region KS from the background region Wb. Specifically, the brightness of each pixel within the background region Wb is obtained, and a region constituted by pixels, of which: the brightness is lower than the average brightness of the local region Q0; and the difference in the brightness from the average brightness of the local region Q0 is greater than a predetermined threshold value is extracted as the shadow region KS.
The ID card generating systems described in the embodiments above remove shadow regions from the facial images themselves when removing shadows. Therefore, shadows can be removed without background images, in which only backgrounds are pictured.
The preferred embodiments of the present invention have been described above. However, the present invention is not limited to the above embodiments. Various changes and modifications can be made as long as they do not depart from the spirit of the invention.
For example, in the case that the local region is determined by detecting the facial region from within the facial image, as in the ID card issuing system A of the first embodiment, any face detecting technique may be employed, as long as the position and the size of the face within the facial image can be obtained.
In addition, during extraction of the background region, the shadowless background region, and the shadow region, the color space is not limited to that of hue, saturation, and brightness. An RGB color space, a Lab color space, or the like may alternatively be employed.
Number | Date | Country | Kind |
---|---|---|---|
305638/2004 | Oct 2004 | JP | national |