WO2017092431A1 - Human hand detection method and device based on skin colour - Google Patents

Human hand detection method and device based on skin colour Download PDF

Info

Publication number
WO2017092431A1
WO2017092431A1 PCT/CN2016/096982 CN2016096982W WO2017092431A1 WO 2017092431 A1 WO2017092431 A1 WO 2017092431A1 CN 2016096982 W CN2016096982 W CN 2016096982W WO 2017092431 A1 WO2017092431 A1 WO 2017092431A1
Authority
WO
WIPO (PCT)
Prior art keywords
skin
pixel
hsv
image
binary image
Prior art date
Application number
PCT/CN2016/096982
Other languages
French (fr)
Chinese (zh)
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 WO2017092431A1 publication Critical patent/WO2017092431A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/107Static hand or arm
    • G06V40/11Hand-related biometrics; Hand pose recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/253Fusion techniques of extracted features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/30Noise filtering

Definitions

  • the present application relates to the field of computer vision, and in particular, to a human hand detection method and apparatus based on skin color.
  • gesture recognition is increasingly being valued.
  • a gesture-based human-computer interaction system it is necessary to first acquire the position of the hand in the image.
  • the most common method currently used is to obtain gesture information by detecting the skin color.
  • the most common segmentation method at present is based on skin color segmentation.
  • the statistic-based skin color detection method mainly uses skin color statistical model to detect skin color, which mainly includes two steps: color space transformation and skin color modeling; physics-based method introduces the interaction between light and skin in skin color detection, through research Skin color reflection model and spectral characteristics for skin color detection.
  • the recognition efficiency of the human hand shape is low, the false detection rate is high, and it is very susceptible to illumination, thereby causing the accuracy of gesture recognition to be limited.
  • the embodiment of the present invention provides a human hand detection method and device based on skin color, which is used to solve the defects in the prior art that the skin color detection and the human hand recognition method based on statistics are low in efficiency, high in false detection rate, and highly susceptible to illumination.
  • the recognition of human hand based on skin color detection is highly efficient and accurate, thereby further improving the accuracy of gesture recognition.
  • the embodiment of the present application provides a human hand detection method based on skin color, including:
  • the pre-trained K-nearest neighbor classifier is used to determine whether the largest connected area is a hand shape, thereby realizing human hand recognition.
  • the embodiment of the present application provides a human hand detecting device based on skin color, including:
  • An image conversion module configured to convert the acquired image to be detected from an RGB color space to an HSV color space to acquire an HSV image, and convert the image to be detected from an RGB color space to an r-g color space to obtain an r-g image;
  • a binary map obtaining module configured to traverse each pixel in the HSV image, and convert the HSV image into a first binary image according to a pre-established HSV histogram model, and traverse the read
  • Each pixel in the rg image converts the rg image into a second binary image according to a pre-established mixed Gaussian model
  • bitwise operation module configured to perform a bitwise AND operation on the first binary image and the second binary image to obtain a comprehensive binary image
  • a filtering module configured to filter the integrated binary image to obtain an optimized binary image
  • a connected area judging module configured to analyze a largest connected area in the optimized binary image, and use the largest connected area as a skin area
  • the human hand identification module is configured to determine whether the maximum connected area is a hand shape using a pre-trained K-nearest neighbor classifier, thereby realizing human hand recognition.
  • An embodiment of the present application provides an electronic device, including the skin color based person according to any of the foregoing embodiments. Hand detection method.
  • the embodiment of the present application provides a non-transitory computer readable storage medium, wherein the non-transitory computer readable storage medium can store computer instructions, which can implement the skin color based hand provided by the embodiments of the present application. Part or all of the steps in each implementation of the detection method.
  • An embodiment of the present application provides an electronic device, including: one or more processors; and a memory; wherein the memory stores instructions executable by the one or more processors, the instructions being set to A method for detecting a human hand based on skin color according to any of the above-mentioned applications of the present application.
  • An embodiment of the present application provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, The computer is caused to perform the human skin detection method based on any of the above-mentioned embodiments of the present application.
  • the skin color detecting method and device provided by the embodiments of the present application achieve high-accuracy detection of the skin region by comprehensively applying the HSV histogram, the mixed Gaussian model, the filtering denoising, and the connected domain extraction method, and at the same time, through the K-nearest neighbor
  • the classifier enables fast and accurate manual extraction.
  • Embodiment 1 is a technical flowchart of Embodiment 1 of the present application.
  • Embodiment 2 is a technical flowchart of Embodiment 2 of the present application.
  • Embodiment 3 is a technical flowchart of Embodiment 3 of the present application.
  • FIG. 4 is a schematic structural diagram of a device according to Embodiment 4 of the present application.
  • FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • a human hand detection method based on skin color includes the following steps:
  • Step 110 Convert the acquired image to be detected from the RGB color space to the HSV color space to obtain an HSV image, and convert the image to be detected from the RGB color space to the r-g color space to obtain an r-g image;
  • step 111 In order to make the logical description clearer, the following steps are divided into two steps: step 111 and step 112. It should be noted that there is no order between step 111 and step 112, and the following description is performed in the order of Does not constitute a limit.
  • Step 111 Convert the acquired image to be detected from the RGB color space to the HSV color space to obtain an HSV image.
  • the RGB color space is obtained by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other.
  • RGB stands for red and green.
  • HSV HumanSaturation Value
  • the color space is a color space created based on the intuitive characteristics of the color. H, S, and V represent hue, saturation, and brightness, respectively. Converting the image to be detected from RGB color space to HSV color space overcomes the influence of illumination changes on skin color detection to some extent.
  • Both RGB and CMY color models are hardware oriented
  • the HSV (Hue Saturation Value) color model is user-oriented.
  • the three-dimensional representation of the HSV model evolved from the RGB cube. Imagine looking at the hexagonal shape of the cube from the white vertices of the RGB along the cube's diagonal to the black vertices.
  • the hexagonal boundary represents color, the horizontal axis represents purity, and the brightness is measured along the vertical axis.
  • the image to be detected is converted from the RGB color space to the HSV color space by using the following formula:
  • V max(R, G, B)
  • R is the red value of the pixel
  • G is the green value of the pixel
  • B is the blue value of the pixel
  • max() indicates the maximum value operation
  • min() indicates the minimum value operation
  • V is the maximum value among R, G, and B
  • H, S, and V are the color values corresponding to the pixel points after the conversion, respectively.
  • Step 112 Convert the image to be detected from an RGB color space to an r-g color space to obtain an r-g image.
  • the RGB image is converted from the RGB color space to the r-g color space by using the following formula:
  • R is the red value of the pixel
  • G is the green value of the pixel
  • B is the blue value of the pixel
  • r, g, b are the color values corresponding to the pixel after conversion .
  • the RGB color space here refers to a variety of colors by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other.
  • RGB has 256 levels each. Brightness, expressed as numbers from 0, 1, 2... up to 255.
  • An RGB color value specifies the relative brightness of the three primary colors of red, green, and blue, producing a specific color for display, that is, any one color can be recorded and expressed by a set of RGB values.
  • the RGB value corresponding to a pixel is (149, 123, 98), and the color of this pixel is a superposition of different brightnesses of the three colors of RGB.
  • the RGB value corresponding to each pixel in the picture can be directly obtained by using OpenCv, and the implementation code can be like this:
  • channels 0, 1, and 2 correspond to the brightness values of the three colors of blue, green, and red, respectively;
  • converting the color space from RGB to r-g is actually a normalization process for RGB colors.
  • this normalization process when a pixel is affected by light or shadow and the color channel R, G, and B values change, the numerator and denominator in the normalization formula change simultaneously, and the normalized value obtained actually The float is not large, this transformation removes the information of the light from the image, thus reducing the effects of lighting.
  • the pixel value of pixel A at the time T1 before normalization is: RGB (30, 60, 90), and at time T2, the color values of the three color channels of RGB are changed due to the influence of illumination, and the pixel value of pixel A is changed. It becomes RGB (60, 120, 180).
  • the pixel value of pixel A at time T1 is: RGB (1/6, 1/3, 2/3)
  • the pixel value of pixel A at time T2 is: RGB (1/ 6, 1/3, 2/3). It can be seen that the values of the normalized RGB at the time of T1 and T2 do not change.
  • Step 120 traversing and reading each pixel in the HSV image, and converting the HSV image into a first binary image according to a pre-established HSV histogram model, and traversing and reading each of the rg images a pixel point, converting the rg image into a second binary image according to a pre-established mixed Gaussian model;
  • step 120 is split into five steps: step 121 to step 125.
  • step 121 to step 125 There is no fixed sequence in the actual implementation of the steps 122 to 125, and the embodiment of the present application is not limited.
  • Step 121 Read an HSV value of the pixel, and calculate a matching probability value between the HSV value and an HSV histogram model of the skin pixel and an HSV histogram model of the non-skin pixel, respectively, according to the matching.
  • the degree value determines whether the pixel belongs to a skin area
  • the pixel is assigned with x, and if the pixel does not belong to the skin region, the pixel is assigned with y, thereby obtaining the first binary image.
  • x generally takes 255
  • y generally takes 0.
  • the pre-trained HSV histogram model stores a histogram distribution of HSV values of skin pixels and non-skin pixels. This distribution is used as a reference for determining whether a new pixel is a skin pixel in the embodiment of the present application. .
  • the implementation is: reading an HSV value of the pixel in the image to be detected, and calculating a matching probability value between the HSV value and the HSV histogram model of the skin pixel and the HSV histogram model of the non-skin pixel, respectively. And determining, according to the matching degree value, whether the pixel point belongs to a skin area.
  • the detection result has a certain stability to the change of the illumination.
  • S122 calculating a first probability density of the pixel point under the skin-mixed Gaussian model and a second probability density of the pixel point under the non-skin mixed Gaussian model;
  • the mixed Gaussian model GMM also known as MOG, is an extension of the single Gaussian model, which uses K (basically 3 to 10) Gaussian models to characterize the individual pixels in the image.
  • x is the d-dimensional Euclidean space
  • a is the mean vector of the single Gaussian model
  • S is the covariance matrix of the single Gaussian model
  • T represents the transpose operation of the matrix
  • () -1 represents the inverse of the matrix .
  • the formula of the mixed Gaussian model is formed by adding K single Gaussian models according to the weights, and is expressed by the following formula:
  • ⁇ k is the weight of the kth Gaussian model
  • m is the number of preset Gaussian models
  • p k (x) is the kth single Gaussian model.
  • x belongs to d-dimensional Euclidean space
  • m is the number of preset Gaussian models
  • p k (x) is the probability density of the k-th Gaussian model
  • a k is the mean of the k-th Gaussian model.
  • S k is the covariance matrix of the kth Gaussian model
  • ⁇ k is the weight of the kth Gaussian model;
  • a mixed Gaussian model is established for the skin pixel and the non-skin pixel respectively, and the formulas of the two models are the same, except that the parameters in the model, that is, the mean vector a k and the covariance matrix S k are different.
  • the embodiment of the present application calculates its first probability density under the skin-mixed Gaussian model, and calculates its second probability density under the non-skin mixed Gaussian model until all pixel points are traversed.
  • the traversing process may be traversing by column by column, or may randomly select a pixel to determine whether it is a pixel of the skin region, and if so, first within a certain size neighborhood thereof Pixels are traversed, and the application is not limited.
  • the mean vector of the skin-mixed Gaussian model is a k1
  • the covariance matrix is S k1
  • the weights of the plurality of single Gaussian models respectively correspond to ⁇ k1
  • the mean vector of the non-skin mixed Gaussian model is a k2
  • the covariance matrix is S k2
  • the weights corresponding to the multiple single Gaussian models are respectively ⁇ k2 ,
  • the calculation formula of the posterior probability is as follows:
  • P is the value of the posterior probability
  • p skin is the first probability density
  • p non-skin is the second probability density
  • the embodiment of the present application sets the posterior probability threshold to 0.5, that is, when the value of the posterior probability exceeds 0.5, it is determined that the pixel corresponding to the posterior probability belongs to the skin region.
  • the posterior probability threshold of 0.5 is an empirical value. It is judged by a large number of experiments that if a pixel point belongs to the skin pixel, the posterior probability exceeds 0.5, and this pixel belongs to the skin area of the image.
  • the posterior probability threshold may also be dynamically adjusted, and the application is not limited thereto.
  • the first binary image and the second binary image under the mixed Gaussian model are described.
  • Step 130 performing a bitwise AND operation on the first binary image and the second binary image to obtain a comprehensive binary image.
  • the operation principle of the bitwise AND operation is that if both numbers in the same position are 1, the operation result is 1; if one is not 1, the operation result is 0.
  • the result of the bitwise operation is The pixel belongs to the skin pixel; if the matching result of the HSV histogram model and the mixed Gaussian model is inconsistent, the result of the bitwise operation is that the pixel belongs to a non-skin pixel.
  • Step 140 Filter the integrated binary image to obtain an optimized binary image.
  • the integrated binary image is denoised by median filtering to remove some scattered pixel points in the binarized image, thereby improving the efficiency of subsequently searching for the connected region.
  • Median filtering is a very mature algorithm, which can eliminate the noise of the image.
  • the basic principle is that the pixel value of a certain position in the target image depends on the same position of the original image and the pixel value in the vicinity, for example, the pixel of a certain position of the original image. There are 9 pixels in the vicinity thereof, and after sorting the 9 pixel values, the pixel value located in the middle is taken as the pixel value of the target image pixel.
  • Step 150 Analyze a largest connected area in the optimized binary image, and use the largest connected area as a skin area.
  • Connected Component generally refers to an image region (Region, Blob) composed of foreground pixel points having the same pixel value and adjacent in the image.
  • Connected Component Analysis refers to finding and marking each connected area in an image.
  • the object of the connected area analysis processing is a binarized image.
  • a connected area is composed of adjacent pixels having the same pixel value, so that the connected area can be found in the image by these two conditions, and each connected area is given A unique label (Label) to distinguish other connected areas.
  • the two-pass scanning method means that by scanning two images, all connected areas existing in the image can be found and marked.
  • the main implementation idea is as follows: a label is given to each pixel position during the first scan, and one or more different labels may be assigned to the pixel set in the same connected area during the scanning process, so these need to be connected to the same one. Regions but labels with different values are merged, that is, the equality relationship between them is recorded; the second pass scan is to classify the pixels marked by equal_labels with equal relationship into one connected region and give the same label (usually this label is equal_labels) The minimum value).
  • the seed filling method is derived from computer graphics and is often used to fill a graphic.
  • the main idea is to select a foreground pixel as a seed, and then merge the foreground pixels adjacent to the seed into the same pixel set according to the two basic conditions of the connected region (the pixel values are the same and the positions are adjacent).
  • the set of pixels is a connected area.
  • the pixel neighboring relationship in the connected area mainly has 4 neighborhoods and 8 neighborhoods.
  • the 4th neighborhood is used to analyze the largest connected area in the optimized binary image.
  • Step 160 Determine whether the largest connected area is a hand shape by using a pre-trained K-nearest neighbor classifier, thereby implementing recognition of a gesture.
  • the K-nearest neighbor classifier is a very mature classifier.
  • the principle is that if the number of data of the i-th class is the majority of the M data closest to a certain data, the data belongs to the i-th class.
  • the data is generally a vector that can represent the characteristics of the class.
  • the key to pre-training the K-nearest neighbor classifier is to extract the features of the sample pictures and classify the sample pictures into different classes based on these characteristics.
  • the embodiment of the present application selects the following four features:
  • Feature 1 Ratio of the square of the perimeter of the connected area to the area
  • Feature 2 area of the connected area
  • Feature 3 the probability mean value of the connected region pixels obtained by the GMM (mixed Gaussian model) belonging to the skin region;
  • Feature 4 the mean probability of the connected region pixels obtained by the HSV histogram model belonging to the skin;
  • the feature 3 and the feature 4 are calculated by calling the HSV histogram model and the GMM hybrid Gaussian model which are pre-trained in the embodiment of the present application, and are not described here.
  • the pre-trained K-nearest neighbor classifier obtains samples of the hand region and the non-hand region by using a certain number of hand-shaped and non-hand-shaped image samples and calculating features 1 to 4 of the largest connected region. For a connected graph to be detected, the above features 1 to 4 are extracted, and based on the statistical results of the samples, whether the human hand region is included in the connected graph can be determined.
  • the specific implementation may be such that the similarity ratios of the features 1 to 4 in the connectivity graph to the feature 1 to the feature 4 in the K neighbor neighbor classifier are determined one by one, and a reasonable threshold is set for the similarity rate. When the similarity ratio is greater than the threshold, it is determined that the connected graph to be detected includes a human hand region.
  • the skin pixels in the image to be detected are identified based on the HSV histogram and the GMM model detection by the image to be detected; further, the comprehensive operation and filtering of the two different model detection methods are used to obtain the The optimized binary image corresponding to the image to be detected; through the analysis of the maximum connected region and the judgment of the K neighborhood classifier, the hand shape recognition is accurately realized, and the speed detection and the error detection of the hand shape in the prior art are effectively solved. Thereby indirectly improving the efficiency of gesture recognition in human-computer interaction.
  • FIG. 2 is a technical flowchart of the second embodiment of the present application.
  • the training of the HSV histogram model is mainly implemented by the following steps:
  • Step 210 Perform marking of the skin region and the non-skin region on the sample image to obtain a skin pixel sample and a non-skin pixel sample;
  • the marking of the sample can be done manually to ensure a high degree of accuracy of the sample.
  • Step 220 Convert the skin pixel sample and the non-skin pixel sample from an RGB color space to an HSV color space to obtain a skin HSV pixel sample and a non-skin HSV pixel sample;
  • step 110 of the first embodiment The specific implementation formula and the technical effect of the conversion from the RGB color space to the HSV color space are shown in step 110 of the first embodiment, and are not described herein again.
  • Step 230 Statistics the HSV value of the skin HSV pixel sample, and establish an HSV histogram model of the skin pixel according to the distribution of the HSV value of the skin HSV pixel sample;
  • the frequency distribution of the H value (hue), S value (saturation), and V value (brightness) is separately calculated for the pixel points of the skin sample, thereby establishing an HSV histogram model of the skin pixel, and at the same time The same operation is performed on the pixels of the non-skin sample.
  • the core of the present application is that the gray level of the HSV histogram model is compressed according to a preset proportional relationship to obtain an optimized histogram statistical effect.
  • H, S and V channels each have 256 gray levels, if all of the gray level histogram of length 224, is approximately 16 million, this effect can not be obtained when good statistical sample size is not large enough. Therefore, the embodiment of the present application compresses the length of the histogram, and the ratio of compression can be selected according to experience.
  • the H channel is compressed by 64 gray levels in a ratio of 4:2:1
  • the S channel is compressed to 32 gray levels
  • V channel is compressed to 16 gray levels
  • the length is 2 15 , which is 65536.
  • the HSV uses three different gray levels for the three channels, because the three channels of HSV are affected by the light intensity, the H (chrominance) channel is not affected by the illumination change, the V channel is proportional to the change of the light intensity, and the S channel is illuminated.
  • the degree of influence is somewhere in between.
  • Step 240 Statistics the HSV value of the non-skin HSV pixel sample, and according to the non-skin HSV The distribution of HSV values for pixel samples establishes an HSV histogram model of non-skin pixels.
  • step 230 The execution process and technical effect of establishing the HSV histogram model for the non-skin pixel samples are the same as the above step 230, and will not be described here. It should be noted that there is no actual order in the step 230 and the step 240. The embodiment of the present application is not limited.
  • the HSV histogram model of the skin pixel and the non-skin pixel is respectively established by training the skin sample and the non-skin sample and compressing the gray level of the HSV histogram, even if the number of training samples is small, Reduce the false detection rate of skin pixels.
  • FIG. 3 is a technical flowchart of Embodiment 3 of the present application.
  • the establishment of a mixed Gaussian model mainly includes the following steps:
  • Step 310 Mark a skin pixel area and a non-skin pixel area of the RGB sample picture to obtain a skin pixel sample and a non-skin pixel sample.
  • the RGB sample picture is first marked, which may be artificial, to distinguish the skin area and the non-skin area in the picture, that is, the skin pixel sample and the non-skin pixel sample are obtained. Pre-classifying the samples helps to improve the efficiency of the subsequent EM algorithm in calculating the parameters of the mixed Gaussian model and how close the parameters are to the actual model.
  • Step 320 Convert the skin pixel sample and the non-skin pixel sample from an RGB color space to an r-g color space;
  • R is the red value of the pixel
  • G is the green value of the pixel
  • B is the blue value of the pixel
  • r, g, b are the color values corresponding to the pixel after conversion .
  • Step 330 Calculate parameters of the skin pixel mixed Gaussian model and the non-skin pixel mixed Gaussian model according to the skin space converted skin sample and the non-skin pixel sample, respectively, using an expectation maximization algorithm.
  • the parameters include a k , S k and ⁇ k .
  • the mixed Gaussian model is a superposition of multiple single Gaussian models.
  • the weight of each single Gaussian model is different, that is, the data in the mixed Gaussian model is generated from several single Gaussian models.
  • the number K of the single Gaussian model needs to be set in advance, and ⁇ k is the weight of each single Gaussian model.
  • the Expectation Maximization (EM) algorithm is an algorithm for finding a parameter maximum likelihood estimate or a maximum a posteriori estimate in a probabilistic model, where the probability model relies on an unobservable hidden variable.
  • the EM algorithm provides an efficient iterative procedure to calculate the maximum likelihood estimate for these data.
  • the iteration is divided into two steps at each step: the Expectation step and the Maximization step, hence the EM algorithm.
  • the EM algorithm is a very mature algorithm and the derivation process is complicated, which is not described in detail in the embodiment of the present application.
  • Step 340 Establish a mixed Gaussian model according to the mixed Gaussian model formula.
  • the mean vector a k1 of the skin mixed Gaussian model, the covariance matrix S k1 and the weights ⁇ k1 corresponding to the multiple single Gaussian models can be calculated and substituted into the mixed Gaussian model formula.
  • the mean vector a k2 of the non-skin mixed Gaussian model, the covariance matrix S k2 , and the weights ⁇ k2 corresponding to the plurality of single Gaussian models respectively can be calculated, and the obtained non-skin mixture is obtained.
  • the Gaussian model is:
  • each pixel of the picture to be detected is read after the color space is transformed, and the pixel is substituted into the two models, and the pixel points are respectively calculated. Skin and p non-skin .
  • the EM algorithm is used to establish a mixed Gaussian model of skin pixels and non-skin pixels, and the prior art based on the histogram Compared with skin color detection, a large number of training samples are not needed, which saves various resource consumption and improves the efficiency of skin color detection.
  • the establishment of the HSV histogram model and the establishment of the mixed Gaussian model are not sequential, and the matching process between the image to be detected and any of the above two models is also in no order.
  • the layout of the various embodiments of the present application is merely illustrative of the respective establishment processes of the two models, and the order of use of the order in which they are established is not limited.
  • the non-transitory computer readable storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
  • a human hand detection method based on skin color mainly includes the following large modules: an image conversion module 410, a binary image acquisition module 420, and a bitwise position.
  • the image conversion module 410 is configured to convert the acquired image to be detected from an RGB color space to an HSV color space to acquire an HSV image, and convert the image to be detected from an RGB color space to an rg color space to obtain an rg image. ;
  • the binary map obtaining module 420 is configured to traverse each pixel in the HSV image and call the HSV histogram model pre-established by the model training module 460 to convert the HSV image into the first two a value image, and traversing each pixel point in the rg image, calling a mixed Gaussian model pre-established by the model training module to convert the rg image into a second binary image;
  • the bitwise operation module 430 is configured to perform a bitwise AND operation on the first binary image and the second binary image to obtain a comprehensive binary image;
  • the filtering module 440 is configured to filter the integrated binary image to obtain an optimized binary image
  • the connected area determining module 450 is configured to analyze a largest connected area in the optimized binary image, and use the largest connected area as a skin area.
  • model training module 460 is configured to:
  • model training module 460 is further configured to:
  • the binary map obtaining module 420 is further configured to:
  • the pixel is assigned with x, and if the pixel belongs to the skin region, the pixel is assigned with y, thereby obtaining the first binary image;
  • the binary map obtaining module 420 is further configured to:
  • the pixel point is attributed to the skin region
  • the pixel is assigned with x, and if the pixel does not belong to the skin region, the pixel is assigned with y, thereby obtaining the first binary image and the The second binary image is described.
  • the connected area determining module 450 is further configured to:
  • the pre-trained K-nearest neighbor classifier is used to determine whether the largest connected area is a hand shape, thereby realizing recognition of a gesture.
  • an electronic device comprising the skin color based human hand detecting device according to any of the preceding embodiments.
  • a non-transitory computer readable storage medium is also provided, the non-transitory computer readable storage medium storing computer executable instructions executable by any of the above methods.
  • FIG. 5 is a schematic diagram of a hardware structure of an electronic device for performing a skin-based human hand detection method according to an embodiment of the present application. As shown in FIG. 5, the device includes:
  • processors 510 and memory 520 one processor 510 is taken as an example in FIG.
  • the apparatus for performing the skin color based human hand detection method may further include: an input device 530 and an output device 440.
  • the processor 510, the memory 520, the input device 530, and the output device 540 may be connected by a bus or other means, as exemplified by a bus connection in FIG.
  • the memory 520 is used as a non-transitory computer readable storage medium, and can be used for storing a non-volatile software program, a non-volatile computer executable program, and a module, such as a skin-based human hand detection method in the embodiment of the present application.
  • Program instructions/modules for example, image conversion module 410, binary image acquisition module 420, bitwise operation module 430, filter module 440, connected region determination module 450, and model training module 460 shown in FIG. 4).
  • the processor 510 executes various functional applications and data processing of the electronic device by running non-volatile software programs, instructions, and modules stored in the memory 520, that is, on the implementation.
  • the method embodiment is based on a human hand detection method of skin color.
  • the memory 520 may include a storage program area and an storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to use of the skin color-based human hand detection device, and the like.
  • the memory 520 may include a high speed random access memory, and may also include a nonvolatile memory such as at least one magnetic disk storage device, flash memory device, or other nonvolatile solid state storage device.
  • memory 520 can optionally include a memory remotely located relative to processor 510 that can be connected to a skin tone based hand detection device over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the input device 530 can receive input numeric or character information and generate key signal inputs related to user settings and function control of the skin tone based hand detection device.
  • the output device 540 can include a display device such as a display screen.
  • the one or more modules are stored in the memory 520, and when executed by the one or more processors 510, perform a skin tone based human hand detection method in any of the above method embodiments.
  • the electronic device of the embodiment of the present application exists in various forms, including but not limited to:
  • Mobile communication devices These devices are characterized by mobile communication functions and are mainly aimed at providing voice and data communication.
  • Such terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
  • Ultra-mobile personal computer equipment This type of equipment belongs to the category of personal computers, has computing and processing functions, and generally has mobile Internet access.
  • Such terminals include: PDAs, MIDs, and UMPC devices, such as the iPad.
  • Portable entertainment devices These devices can display and play multimedia content. Such devices include: audio, video players (such as iPod), handheld game consoles, e-books, and smart toys and portable car navigation devices.
  • the server consists of a processor, a hard disk, a memory, a system bus, etc.
  • the server is similar to a general-purpose computer architecture, but due to the need to provide highly reliable services, Therefore, it is highly demanded in terms of processing power, stability, reliability, security, scalability, and manageability.
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.

Abstract

Provided is a human hand detection method based on a skin colour. The method comprises: converting an acquired image to be detected from an RGB colour space into an HSV colour space to acquire an HSV image, and converting the image to be detected from the RGB colour space into an r-g colour space to acquire an r-g image; converting the HSV image into a first binary image, and converting the r-g image into a second binary image; performing a bitwise AND operation on the first binary image and the second binary image so as to obtain a comprehensive binary image; filtering the comprehensive binary image to acquire an optimized binary image; analysing a maximum connected region in the optimized binary image, and taking the maximum connected region as a skin region; using a pre-trained K neighbour classifier to determine whether the maximum connected region is in a hand shape, thereby realizing human hand recognition. The method has a rapid detection speed, and effectively avoids the human hand error detection in gesture recognition.

Description

基于肤色的人手检测方法及装置Skin color based hand detection method and device
本申请要求于2015年12月1日提交中国专利局、申请号为201510870145.1、申请名称为“基于肤色的人手检测方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201510870145.1, filed on Dec. 1, 2015, the entire disclosure of which is hereby incorporated by reference. in.
技术领域Technical field
本申请涉及计算机视觉领域,尤其涉及一种基于肤色的人手检测方法及装置。The present application relates to the field of computer vision, and in particular, to a human hand detection method and apparatus based on skin color.
背景技术Background technique
在与人有关的各种机器视觉系统中,手势识别越来越多的被重视,例如在基于手势的人机交互系统中,需要首先图像中获取手的位置。而当前最常用的方法就是通过对肤色进行检测从而获取手势信息。将手从图像分割出来,目前最常用的分割方法就是基于肤色的分割。In various machine vision systems related to people, gesture recognition is increasingly being valued. For example, in a gesture-based human-computer interaction system, it is necessary to first acquire the position of the hand in the image. The most common method currently used is to obtain gesture information by detecting the skin color. Splitting your hand from the image, the most common segmentation method at present is based on skin color segmentation.
根据有没有涉及成像的过程,肤色检测的方法分成两种基本类型:基于统计的方法和基于物理的方法。基于统计的肤色检测方法主要通过建立肤色统计模型进行肤色检测,主要包括两个步骤:颜色空间变换和肤色建模;基于物理的方法则在肤色检测中引入光照与皮肤间的相互作用,通过研究肤色反射模型和光谱特性进行肤色检测。Depending on whether there is a process involving imaging, skin color detection methods fall into two basic types: statistical-based methods and physics-based methods. The statistic-based skin color detection method mainly uses skin color statistical model to detect skin color, which mainly includes two steps: color space transformation and skin color modeling; physics-based method introduces the interaction between light and skin in skin color detection, through research Skin color reflection model and spectral characteristics for skin color detection.
然而现有的基于统计的肤色检测方法中,人手形的识别效率低、误检率高且非常容易受到光照的影响,从而导致手势识别的准确度受到限制。However, in the existing statistical-based skin color detecting method, the recognition efficiency of the human hand shape is low, the false detection rate is high, and it is very susceptible to illumination, thereby causing the accuracy of gesture recognition to be limited.
因此,一种快速且高质量的人手检测方法亟待提出。Therefore, a fast and high-quality human hand detection method needs to be proposed.
发明内容Summary of the invention
本申请实施例提供一种基于肤色的人手检测方法及装置,用以解决现有技术中基于统计的肤色检测及人手识别方法效率低、误检率高且非常容易受到光照的影响的缺陷,实现了基于肤色检测的人手高效率、高准确性的识别,从而进一步提高了手势识别的准确度。The embodiment of the present invention provides a human hand detection method and device based on skin color, which is used to solve the defects in the prior art that the skin color detection and the human hand recognition method based on statistics are low in efficiency, high in false detection rate, and highly susceptible to illumination. The recognition of human hand based on skin color detection is highly efficient and accurate, thereby further improving the accuracy of gesture recognition.
本申请实施例提供一种基于肤色的人手检测方法,包括: The embodiment of the present application provides a human hand detection method based on skin color, including:
将获取到的待检测图像从RGB颜色空间转换到HSV颜色空间以获取HSV图像,并将所述待检测图像从RGB颜色空间转换到r-g颜色空间以获取r-g图像;Converting the acquired image to be detected from the RGB color space to the HSV color space to obtain an HSV image, and converting the image to be detected from the RGB color space to the r-g color space to obtain an r-g image;
遍历读取所述HSV图像中的每一像素点,并根据预先建立的HSV直方图模型将所述HSV图像转化为第一二值图像,并遍历读取所述r-g图像中的每一像素点,根据预先建立的混合高斯模型将所述r-g图像转化为第二二值图像;Traversing each pixel in the HSV image and converting the HSV image into a first binary image according to a pre-established HSV histogram model, and traversing each pixel in the rg image Converting the rg image into a second binary image according to a pre-established mixed Gaussian model;
对所述第一二值图像和所述第二二值图像进行按位与运算从而获得综合二值图像;Performing a bitwise AND operation on the first binary image and the second binary image to obtain a comprehensive binary image;
对所述综合二值图像进行滤波以获取优化后的二值图像;Filtering the integrated binary image to obtain an optimized binary image;
分析所述优化后的二值图像中最大的连通区域,将所述最大的连通区域作为皮肤区域;Analyzing a maximum connected area in the optimized binary image, and using the largest connected area as a skin area;
使用预先训练的K近邻分类器判断所述最大的连通区域是否为手形,从而实现人手的识别。The pre-trained K-nearest neighbor classifier is used to determine whether the largest connected area is a hand shape, thereby realizing human hand recognition.
本申请实施例提供一种基于肤色的人手检测装置,包括:The embodiment of the present application provides a human hand detecting device based on skin color, including:
图像转换模块,用于将获取到的待检测图像从RGB颜色空间转换到HSV颜色空间以获取HSV图像,并将所述待检测图像从RGB颜色空间转换到r-g颜色空间以获取r-g图像;An image conversion module, configured to convert the acquired image to be detected from an RGB color space to an HSV color space to acquire an HSV image, and convert the image to be detected from an RGB color space to an r-g color space to obtain an r-g image;
二值图获取模块,用于遍历读取所述HSV图像中的每一像素点,并根据预先建立的HSV直方图模型将所述HSV图像转化为第一二值图像,并遍历读取所述r-g图像中的每一像素点,根据预先建立的混合高斯模型将所述r-g图像转化为第二二值图像;a binary map obtaining module, configured to traverse each pixel in the HSV image, and convert the HSV image into a first binary image according to a pre-established HSV histogram model, and traverse the read Each pixel in the rg image converts the rg image into a second binary image according to a pre-established mixed Gaussian model;
按位运算模块,用于对所述第一二值图像和所述第二二值图像进行按位与运算从而获得综合二值图像;a bitwise operation module, configured to perform a bitwise AND operation on the first binary image and the second binary image to obtain a comprehensive binary image;
滤波模块,用于对所述综合二值图像进行滤波以获取优化后的二值图像;a filtering module, configured to filter the integrated binary image to obtain an optimized binary image;
连通区域判断模块,用于分析所述优化后的二值图像中最大的连通区域,将所述最大的连通区域作为皮肤区域;a connected area judging module, configured to analyze a largest connected area in the optimized binary image, and use the largest connected area as a skin area;
人手识别模块,用于使用预先训练的K近邻分类器判断所述最大的连通区域是否为手形,从而实现人手的识别。The human hand identification module is configured to determine whether the maximum connected area is a hand shape using a pre-trained K-nearest neighbor classifier, thereby realizing human hand recognition.
本申请实施例提供一种电子设备,包括前述任一实施例所述的基于肤色的人 手检测方法。An embodiment of the present application provides an electronic device, including the skin color based person according to any of the foregoing embodiments. Hand detection method.
本申请实施例提供一种非暂态计算机可读存储介质,其中,该非暂态计算机可读存储介质可存储有计算机指令,该计算机指令执行时可实现本申请实施例提供的基于肤色的人手检测方法的各实现方式中的部分或全部步骤。The embodiment of the present application provides a non-transitory computer readable storage medium, wherein the non-transitory computer readable storage medium can store computer instructions, which can implement the skin color based hand provided by the embodiments of the present application. Part or all of the steps in each implementation of the detection method.
本申请实施例提供一种电子设备,包括:一个或多个处理器;以及,存储器;其中,所述存储器存储有可被所述一个或多个处理器执行的指令,所述指令被设置为用于执行本申请上述任一项基于肤色的人手检测方法。An embodiment of the present application provides an electronic device, including: one or more processors; and a memory; wherein the memory stores instructions executable by the one or more processors, the instructions being set to A method for detecting a human hand based on skin color according to any of the above-mentioned applications of the present application.
本申请实施例提供一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行本申请实施例上述任一项基于肤色的人手检测方法。An embodiment of the present application provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, The computer is caused to perform the human skin detection method based on any of the above-mentioned embodiments of the present application.
本申请实施例提供的肤色检测方法及装置,通过综合运用HSV直方图、混合高斯模型、滤波去噪以及连通域提取的方法,实现了皮肤区域的高准确度检测,与此同时,通过K近邻分类器实现了快速精准的人手提取。The skin color detecting method and device provided by the embodiments of the present application achieve high-accuracy detection of the skin region by comprehensively applying the HSV histogram, the mixed Gaussian model, the filtering denoising, and the connected domain extraction method, and at the same time, through the K-nearest neighbor The classifier enables fast and accurate manual extraction.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings to be used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are Some embodiments of the present application can also obtain other drawings based on these drawings without departing from the prior art by those skilled in the art.
图1为本申请实施例一的技术流程图;1 is a technical flowchart of Embodiment 1 of the present application;
图2为本申请实施例二的技术流程图;2 is a technical flowchart of Embodiment 2 of the present application;
图3为本申请实施例三的技术流程图;3 is a technical flowchart of Embodiment 3 of the present application;
图4为本申请实施例四的装置结构示意图;4 is a schematic structural diagram of a device according to Embodiment 4 of the present application;
图5为本申请实施例提供的一种电子设备的结构示意图。FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
具体实施方式detailed description
为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的 实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In the following, the technical solutions in the embodiments of the present application are clearly and completely described in conjunction with the drawings in the embodiments of the present application. The embodiments are a part of the embodiments of the present application, and not all of them. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
需要说明的是,本申请的各个实施例并非独立存在,若干个实施例之间可以相互补充或组合存在。It should be noted that the various embodiments of the present application do not exist independently, and several embodiments may be added to each other in combination or in combination.
实施例一Embodiment 1
图1是本申请实施例一的技术流程图,结合图1,本申请实施例一种基于肤色的人手检测方法包括如下的步骤:1 is a technical flowchart of Embodiment 1 of the present application. Referring to FIG. 1, a human hand detection method based on skin color according to an embodiment of the present application includes the following steps:
步骤110:将获取到的待检测图像从RGB颜色空间转换到HSV颜色空间以获取HSV图像,并将所述待检测图像从RGB颜色空间转换到r-g颜色空间以获取r-g图像;Step 110: Convert the acquired image to be detected from the RGB color space to the HSV color space to obtain an HSV image, and convert the image to be detected from the RGB color space to the r-g color space to obtain an r-g image;
以下部分为了使逻辑描述更加清楚,将步骤110拆分为两个步骤:步骤111和步骤112,需要说明的是,步骤111和步骤112之间并无先后顺序,以下的描述对其执行顺序并不构成限制。In order to make the logical description clearer, the following steps are divided into two steps: step 111 and step 112. It should be noted that there is no order between step 111 and step 112, and the following description is performed in the order of Does not constitute a limit.
步骤111:将获取到的待检测图像从RGB颜色空间转换到HSV颜色空间以获取HSV图像;Step 111: Convert the acquired image to be detected from the RGB color space to the HSV color space to obtain an HSV image.
RGB颜色空间是通过对红(R)、绿(G)、蓝(B)三个颜色通道的变化以及它们相互之间的叠加来得到各式各样的颜色的,RGB即是代表红、绿、蓝三个通道的颜色值,这个标准几乎包括了人类视力所能感知的所有颜色。The RGB color space is obtained by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other. RGB stands for red and green. The color values of the three channels of blue. This standard includes almost all colors that human vision can perceive.
HSV(HueSaturation Value:色度饱和度值)颜色空间是根据颜色的直观特性而创建的一种颜色空间,H、S和V分别代表色调,饱和度和亮度。将待检测的图像从RGB颜色空间转化到HSV颜色空间,在一定程度上克服了光照变化对肤色检测的影响。HSV (HueSaturation Value) The color space is a color space created based on the intuitive characteristics of the color. H, S, and V represent hue, saturation, and brightness, respectively. Converting the image to be detected from RGB color space to HSV color space overcomes the influence of illumination changes on skin color detection to some extent.
在HSV色彩空间中,色调H表示色彩信息,即所处的光谱颜色的位置。H用角度度量,取值范围为0°~360°,从红色开始按逆时针方向计算,红色为0°,绿色为120°,蓝色为240°。它们的补色是:黄色为60°,青色为180°,品红为300°;饱和度S表示成所选颜色的纯度和该颜色最大的纯度之间的比率,S的取值范围为0.0~1.0,值越大,颜色越饱和,S=0时,只有灰度;亮度V通常用百分比度量,从0%(黑)到100%(白)。RGB和CMY颜色模型都是面向硬件 的,而HSV(Hue Saturation Value)颜色模型是面向用户的。HSV模型的三维表示从RGB立方体演化而来。设想从RGB沿立方体对角线的白色顶点向黑色顶点观察,就可以看到立方体的六边形外形。六边形边界表示色彩,水平轴表示纯度,明度沿垂直轴测量。In the HSV color space, the hue H represents color information, that is, the position of the spectral color in which it is located. H is measured by angle, ranging from 0° to 360°. It is calculated from the red counterclockwise direction, red is 0°, green is 120°, and blue is 240°. Their complementary colors are: 60° for yellow, 180° for cyan, and 300° for magenta; S is the ratio between the purity of the selected color and the purity of the color. The value of S ranges from 0.0 to 1.0, the larger the value, the more saturated the color, when S=0, only the gray scale; the brightness V is usually measured in percentage, from 0% (black) to 100% (white). Both RGB and CMY color models are hardware oriented The HSV (Hue Saturation Value) color model is user-oriented. The three-dimensional representation of the HSV model evolved from the RGB cube. Imagine looking at the hexagonal shape of the cube from the white vertices of the RGB along the cube's diagonal to the black vertices. The hexagonal boundary represents color, the horizontal axis represents purity, and the brightness is measured along the vertical axis.
本申请实施例中采用如下的公式将所述待检测图像从RGB颜色空间转换到HSV颜色空间:In the embodiment of the present application, the image to be detected is converted from the RGB color space to the HSV color space by using the following formula:
V=max(R,G,B)V=max(R, G, B)
Figure PCTCN2016096982-appb-000001
Figure PCTCN2016096982-appb-000001
Figure PCTCN2016096982-appb-000002
Figure PCTCN2016096982-appb-000002
其中,R为所述像素点的红色值、G为所述像素点的绿色值、B为所述像素点的蓝色值;max()表示取最大值运算,min()表示取最小值运算,V为R、G、B中的最大值;H、S、V分别为转化后所述像素点对应的颜色值。Where R is the red value of the pixel, G is the green value of the pixel, B is the blue value of the pixel; max() indicates the maximum value operation, and min() indicates the minimum value operation V is the maximum value among R, G, and B; H, S, and V are the color values corresponding to the pixel points after the conversion, respectively.
步骤112:将所述待检测图像从RGB颜色空间转换到r-g颜色空间以获取r-g图像;Step 112: Convert the image to be detected from an RGB color space to an r-g color space to obtain an r-g image.
本申请实施例中,采用如下公式将所述RGB图像从由RGB颜色空间转换到r-g颜色空间:In the embodiment of the present application, the RGB image is converted from the RGB color space to the r-g color space by using the following formula:
Figure PCTCN2016096982-appb-000003
Figure PCTCN2016096982-appb-000003
Figure PCTCN2016096982-appb-000004
Figure PCTCN2016096982-appb-000004
b=1-g-rb=1-g-r
其中,R为所述像素点的红色值、G为所述像素点的绿色值、B为所述像素点的蓝色值;r、g、b分别为转化后所述像素点对应的颜色值。Where R is the red value of the pixel, G is the green value of the pixel, B is the blue value of the pixel; r, g, b are the color values corresponding to the pixel after conversion .
此处的RGB颜色空间是指通过对红(R)、绿(G)、蓝(B)三个颜色通道的变化以及它们相互之间的叠加来得到各式各样的颜色。通常情况下,RGB各有256级 亮度,用数字表示为从0、1、2...直到255。一个RGB颜色值指定红、绿、蓝三原色的相对亮度,生成一个用于显示的特定颜色,即任何一个颜色都可以由一组RGB值来记录和表达。例如,某一像素点对应的RGB值为(149,123,98),这一像素点的颜色为RGB三种颜色的不同亮度的叠加。The RGB color space here refers to a variety of colors by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other. Usually, RGB has 256 levels each. Brightness, expressed as numbers from 0, 1, 2... up to 255. An RGB color value specifies the relative brightness of the three primary colors of red, green, and blue, producing a specific color for display, that is, any one color can be recorded and expressed by a set of RGB values. For example, the RGB value corresponding to a pixel is (149, 123, 98), and the color of this pixel is a superposition of different brightnesses of the three colors of RGB.
本申请实施例中,使用OpenCv可直接获得图片中每一像素点对应的RGB值,实现代码可以是这样:In the embodiment of the present application, the RGB value corresponding to each pixel in the picture can be directly obtained by using OpenCv, and the implementation code can be like this:
CvScalar p;CvScalar p;
p=cvGet2D(ImageIn,j,i);p=cvGet2D(ImageIn,j,i);
double a=p.val[0];Double a=p.val[0];
double b=p.val[1];Double b=p.val[1];
double c=p.val[2];Double c=p.val[2];
其中,i、j分别是像素点在图像上的横纵坐标;通道0、1、2分别对应的是蓝、绿、红三种颜色的亮度数值;Where i and j are the horizontal and vertical coordinates of the pixel on the image respectively; channels 0, 1, and 2 correspond to the brightness values of the three colors of blue, green, and red, respectively;
当值像素值由RGB空间转化到r-g空间后,可以一定程度上克服光照变化对肤色检测的影响。本申请实施例中,将颜色空间由RGB转化为r-g,实际上是对RGB色彩的归一化过程。在这个归一化的过程中,当某个像素受光照或阴影的影响而产生颜色通道R、G、B值变化时,归一化公式中的分子分母同时变化,得到的归一化值实际浮动并不大,这种变换方式从图像上移除了光照的信息,因此可以减弱光照的影响。After the value pixel value is converted from RGB space to r-g space, the influence of illumination changes on skin color detection can be overcome to some extent. In the embodiment of the present application, converting the color space from RGB to r-g is actually a normalization process for RGB colors. In this normalization process, when a pixel is affected by light or shadow and the color channel R, G, and B values change, the numerator and denominator in the normalization formula change simultaneously, and the normalized value obtained actually The float is not large, this transformation removes the information of the light from the image, thus reducing the effects of lighting.
例如:归一化前T1时刻的像素A的像素值为:RGB(30,60,90),T2时刻,由于受光照影响,RGB三个颜色通道的颜色值产生了变化,像素A的像素值变为RGB(60,120,180)。For example, the pixel value of pixel A at the time T1 before normalization is: RGB (30, 60, 90), and at time T2, the color values of the three color channels of RGB are changed due to the influence of illumination, and the pixel value of pixel A is changed. It becomes RGB (60, 120, 180).
经归一化公式转化为r-g空间之后,T1时刻的像素A的像素值为:RGB(1/6,1/3,2/3),T2时刻的像素A的像素值为:RGB(1/6,1/3,2/3)。由此可见,T1和T2时刻的归一化RGB的值并没有发生变化。After the normalization formula is converted into rg space, the pixel value of pixel A at time T1 is: RGB (1/6, 1/3, 2/3), and the pixel value of pixel A at time T2 is: RGB (1/ 6, 1/3, 2/3). It can be seen that the values of the normalized RGB at the time of T1 and T2 do not change.
步骤120:遍历读取所述HSV图像中的每一像素点,并根据预先建立的HSV直方图模型将所述HSV图像转化为第一二值图像,并遍历读取所述r-g图像中的每一像素点,根据预先建立的混合高斯模型将所述r-g图像转化为第二二值图像; Step 120: traversing and reading each pixel in the HSV image, and converting the HSV image into a first binary image according to a pre-established HSV histogram model, and traversing and reading each of the rg images a pixel point, converting the rg image into a second binary image according to a pre-established mixed Gaussian model;
以下部分为了描述更加清楚,将步骤120拆分为五个步骤:步骤121~步骤125。其中,步骤122~步骤125构成的整体与步骤121在实际执行中并无固定的先后顺序,本申请实施例不做限制。The following sections are more clearly described for the sake of clarity, and step 120 is split into five steps: step 121 to step 125. There is no fixed sequence in the actual implementation of the steps 122 to 125, and the embodiment of the present application is not limited.
步骤121:读取所述像素点的HSV值,计算所述HSV值分别与所述皮肤像素的HSV直方图模型以及所述非皮肤像素的HSV直方图模型的匹配概率值,并根据所述匹配程度值判断所述像素点是否属于皮肤区域;Step 121: Read an HSV value of the pixel, and calculate a matching probability value between the HSV value and an HSV histogram model of the skin pixel and an HSV histogram model of the non-skin pixel, respectively, according to the matching. The degree value determines whether the pixel belongs to a skin area;
若所述像素点属于皮肤区域,则以x为所述像素点赋值,若所述像素点不属于皮肤区域,则以y为所述像素点赋值,从而得到所述第一二值图像。其中,x一般取255,y一般取0。If the pixel belongs to the skin region, the pixel is assigned with x, and if the pixel does not belong to the skin region, the pixel is assigned with y, thereby obtaining the first binary image. Among them, x generally takes 255, and y generally takes 0.
预先训练的所述HSV直方图模型中保存有皮肤像素和非皮肤像素的HSV值的直方图分布,本申请实施例中将这种分布作为判断一个新的像素点是否为皮肤像素的一种参考。具体实现为:读取待检测图像中的所述像素点的HSV值,计算所述HSV值分别与所述皮肤像素的HSV直方图模型以及所述非皮肤像素的HSV直方图模型的匹配概率值,并根据所述匹配程度值判断所述像素点是否属于皮肤区域。The pre-trained HSV histogram model stores a histogram distribution of HSV values of skin pixels and non-skin pixels. This distribution is used as a reference for determining whether a new pixel is a skin pixel in the embodiment of the present application. . The implementation is: reading an HSV value of the pixel in the image to be detected, and calculating a matching probability value between the HSV value and the HSV histogram model of the skin pixel and the HSV histogram model of the non-skin pixel, respectively. And determining, according to the matching degree value, whether the pixel point belongs to a skin area.
本实施例中,通过将RGB图像转化至HSV颜色空间,使得进行肤色检测时,检测结果对光照的变化具有一定的稳定性。In this embodiment, by converting the RGB image into the HSV color space, when the skin color detection is performed, the detection result has a certain stability to the change of the illumination.
S122:计算所述像素点在皮肤混合高斯模型下的第一概率密度以及所述像素点在非皮肤混合高斯模型下的第二概率密度;S122: calculating a first probability density of the pixel point under the skin-mixed Gaussian model and a second probability density of the pixel point under the non-skin mixed Gaussian model;
混合高斯模型GMM,也称MOG,是单高斯模型的扩展,它使用K(基本为3到10个)个高斯模型来表征图像中各个像素点的特征。The mixed Gaussian model GMM, also known as MOG, is an extension of the single Gaussian model, which uses K (basically 3 to 10) Gaussian models to characterize the individual pixels in the image.
单高斯模型的公式表述如下所示:The formula for the single Gaussian model is as follows:
Figure PCTCN2016096982-appb-000005
Figure PCTCN2016096982-appb-000005
其中,x属于d维欧几里得空间,a是单高斯模型的均值向量,S是单高斯模型的协方差矩阵,()T表示矩阵的转置运算,()-1表示矩阵的逆运算。Where x is the d-dimensional Euclidean space, a is the mean vector of the single Gaussian model, S is the covariance matrix of the single Gaussian model, () T represents the transpose operation of the matrix, and () -1 represents the inverse of the matrix .
混合高斯模型的公式由K个单高斯模型按照权重累加而成,用下述公式体现:The formula of the mixed Gaussian model is formed by adding K single Gaussian models according to the weights, and is expressed by the following formula:
Figure PCTCN2016096982-appb-000006
Figure PCTCN2016096982-appb-000006
其中,πk是第k个高斯模型的权重,m是预设的高斯模型的个数,pk(x)是第k个单高斯模型。其中,对于第k个单高斯模型,其公式表述如下:Where π k is the weight of the kth Gaussian model, m is the number of preset Gaussian models, and p k (x) is the kth single Gaussian model. Among them, for the kth single Gaussian model, the formula is expressed as follows:
Figure PCTCN2016096982-appb-000007
Figure PCTCN2016096982-appb-000007
如上所述,x属于d维欧几里得空间,m是预设的高斯模型的个数,pk(x)是第k个高斯模型的概率密度,ak是第k个高斯模型的均值向量,Sk是第k个高斯模型的协方差矩阵,πk是第k个高斯模型的权重;As mentioned above, x belongs to d-dimensional Euclidean space, m is the number of preset Gaussian models, p k (x) is the probability density of the k-th Gaussian model, and a k is the mean of the k-th Gaussian model. Vector, S k is the covariance matrix of the kth Gaussian model, and π k is the weight of the kth Gaussian model;
需要说明的是,p(x;ak,Sk,πk)和pk(x)实际计算结果表征的是x在相应模型下的概率密度。It should be noted that the actual calculation results of p(x; a k , S k , π k ) and p k (x) characterize the probability density of x under the corresponding model.
本申请实施例中,对皮肤像素和非皮肤像素分别建立混合高斯模型,两种模型的公式表述相同,不同之处在于模型中的参数,即均值向量ak和协方差矩阵Sk不同。In the embodiment of the present application, a mixed Gaussian model is established for the skin pixel and the non-skin pixel respectively, and the formulas of the two models are the same, except that the parameters in the model, that is, the mean vector a k and the covariance matrix S k are different.
对于待检测图像中的每一个像素点,本申请实施例在皮肤混合高斯模型下计算其第一概率密度,在非皮肤混合高斯模型下计算其第二概率密度,直至遍历所有的像素点。For each pixel in the image to be detected, the embodiment of the present application calculates its first probability density under the skin-mixed Gaussian model, and calculates its second probability density under the non-skin mixed Gaussian model until all pixel points are traversed.
本申请实施例中,所述遍历的过程可以是按行按列逐个遍历,也可以是随机选取一个像素点,判断其是否为皮肤区域的像素点,若是,则首先对其一定尺寸邻域内的像素点进行遍历,本申请并不限制。In the embodiment of the present application, the traversing process may be traversing by column by column, or may randomly select a pixel to determine whether it is a pixel of the skin region, and if so, first within a certain size neighborhood thereof Pixels are traversed, and the application is not limited.
当皮肤混合高斯模型的均值向量为ak1、协方差矩阵为Sk1以及多个单高斯模型分别对应的权重为πk1时,When the mean vector of the skin-mixed Gaussian model is a k1 , the covariance matrix is S k1 , and the weights of the plurality of single Gaussian models respectively correspond to π k1 ,
Figure PCTCN2016096982-appb-000008
Figure PCTCN2016096982-appb-000008
当非皮肤混合高斯模型的均值向量为ak2、协方差矩阵为Sk2以及多个单高斯模型分别对应的权重为πk2时,When the mean vector of the non-skin mixed Gaussian model is a k2 , the covariance matrix is S k2 , and the weights corresponding to the multiple single Gaussian models are respectively π k2 ,
Figure PCTCN2016096982-appb-000009
Figure PCTCN2016096982-appb-000009
S123:根据所述像素点的所述第一概率密度和所述第二概率密度计算所述像 素点属于皮肤区域的后验概率;S123: Calculating the image according to the first probability density and the second probability density of the pixel point The posterior probability that the prime point belongs to the skin area;
本申请实施例中,后验概率的计算公式如下:In the embodiment of the present application, the calculation formula of the posterior probability is as follows:
Figure PCTCN2016096982-appb-000010
Figure PCTCN2016096982-appb-000010
其中,P为所述后验概率的值,pskin为所述第一概率密度;pnon-skin为所述第二概率密度。Where P is the value of the posterior probability, p skin is the first probability density; p non-skin is the second probability density.
S124:当判定所述后验概率大于预设的后验概率阈值时,将所述像素点归属于皮肤区域;S124: When determining that the posterior probability is greater than a preset posterior probability threshold, assigning the pixel to the skin region;
优选地,本申请实施例将所述后验概率阈值设为0.5,即当所述后验概率的值超过0.5时,判断所述后验概率对应的像素点属于皮肤区域。后验概率阈值0.5是一个经验值,经大量的实验判断得出,若一个像素点属于皮肤像素的后验概率超过0.5时,这一像素点属于图像的皮肤区域。当然,根据不同的图片样本,所述后验概率阈值也可以是动态调整的,本申请并不限于此。Preferably, the embodiment of the present application sets the posterior probability threshold to 0.5, that is, when the value of the posterior probability exceeds 0.5, it is determined that the pixel corresponding to the posterior probability belongs to the skin region. The posterior probability threshold of 0.5 is an empirical value. It is judged by a large number of experiments that if a pixel point belongs to the skin pixel, the posterior probability exceeds 0.5, and this pixel belongs to the skin area of the image. Certainly, according to different picture samples, the posterior probability threshold may also be dynamically adjusted, and the application is not limited thereto.
S125:若所述像素点属于皮肤区域,则以x为所述像素点赋值,若所述像素点不属于皮肤区域,则以y为所述像素点赋值,从而得到所述第一二值图像和所述第二二值图像。S125: If the pixel belongs to the skin region, the pixel is assigned with x, and if the pixel does not belong to the skin region, the pixel is assigned with y, thereby obtaining the first binary image. And the second binary image.
本申请实施例的步骤120中,令(x,y)=(255,0),即以255为皮肤像素点赋值,以0为非皮肤像素点赋值,则分别得到HSV直方图模型下的所述第一二值图像以及混合高斯模型下的所述第二二值图像。In step 120 of the embodiment of the present application, (x, y) = (255, 0), that is, 255 is the skin pixel point assignment, and 0 is the non-skin pixel point assignment, then the HSV histogram model is obtained respectively. The first binary image and the second binary image under the mixed Gaussian model are described.
步骤130:对所述第一二值图像和所述第二二值图像进行按位与运算从而获得综合二值图像;Step 130: performing a bitwise AND operation on the first binary image and the second binary image to obtain a comprehensive binary image.
具体的,按位与运算的操作原理为,相同位置的两个数字都为1,则运算结果为1;若有一个不为1,则运算结果为0。在本申请实施例中,对于同一个像素点,若通过与所述HSV直方图模型和所述混合高斯模型的匹配结果均判断所述像素点属于皮肤区域,则按位操作的结果为所述像素点属于皮肤像素;若所述HSV直方图模型和所述混合高斯模型的匹配结果不一致,则按位操作的结果为所述像素点属于非皮肤像素。Specifically, the operation principle of the bitwise AND operation is that if both numbers in the same position are 1, the operation result is 1; if one is not 1, the operation result is 0. In the embodiment of the present application, if the pixel point belongs to the skin area by the matching result of the HSV histogram model and the mixed Gaussian model for the same pixel, the result of the bitwise operation is The pixel belongs to the skin pixel; if the matching result of the HSV histogram model and the mixed Gaussian model is inconsistent, the result of the bitwise operation is that the pixel belongs to a non-skin pixel.
使用按位与运算综合两个检测结果,得到更精确的检测的结果,减少误检测的概率。 Using the bit-and-computation to combine the two test results, the result of more accurate detection is obtained, and the probability of false detection is reduced.
步骤140:对所述综合二值图像进行滤波以获取优化后的二值图像;Step 140: Filter the integrated binary image to obtain an optimized binary image.
本申请实施例中,采用中值滤波对所述综合二值图像进行去噪,用以去除二值化的图像中一些零散的像素点从而提高后续寻找连通区域的效率。In the embodiment of the present application, the integrated binary image is denoised by median filtering to remove some scattered pixel points in the binarized image, thereby improving the efficiency of subsequently searching for the connected region.
中值滤波是很成熟的算法,它可以消除图像的噪声,其基本原理是目标图像中某个位置的像素值取决于原图像同样位置及其附近的像素值,例如原图像某个位置的像素及其附近有9个像素,则对这9个像素值排序后,取位于中间得像素值作为目标图像像素的像素值。Median filtering is a very mature algorithm, which can eliminate the noise of the image. The basic principle is that the pixel value of a certain position in the target image depends on the same position of the original image and the pixel value in the vicinity, for example, the pixel of a certain position of the original image. There are 9 pixels in the vicinity thereof, and after sorting the 9 pixel values, the pixel value located in the middle is taken as the pixel value of the target image pixel.
步骤150:分析所述优化后的二值图像中最大的连通区域,将所述最大的连通区域作为皮肤区域。Step 150: Analyze a largest connected area in the optimized binary image, and use the largest connected area as a skin area.
连通区域(Connected Component)一般是指图像中具有相同像素值且位置相邻的前景像素点组成的图像区域(Region,Blob)。连通区域分析(Connected Component Analysis,Connected Component Labeling)是指将图像中的各个连通区域找出并标记。通常连通区域分析处理的对象是二值化后的图像。A Connected Component generally refers to an image region (Region, Blob) composed of foreground pixel points having the same pixel value and adjacent in the image. Connected Component Analysis (Connected Component Analysis) refers to finding and marking each connected area in an image. Usually, the object of the connected area analysis processing is a binarized image.
从连通区域的定义可以知道,一个连通区域是由具有相同像素值的相邻像素组成像素集合,因此,可以通过这两个条件在图像中寻找连通区域,对于找到的每个连通区域,赋予其一个唯一的标识(Label),以区别其他连通区域。It can be known from the definition of the connected area that a connected area is composed of adjacent pixels having the same pixel value, so that the connected area can be found in the image by these two conditions, and each connected area is given A unique label (Label) to distinguish other connected areas.
连通区域分析的常用算法有Two-Pass(两遍扫描)法和Seed-Filling(种子填充法)。Common algorithms for connected region analysis are Two-Pass and Seed-Filling.
两遍扫描法,正如其名,指的就是通过扫描两遍图像,就可以将图像中存在的所有连通区域找出并标记。其主要实现思路为:第一遍扫描时赋予每个像素位置一个label,扫描过程中同一个连通区域内的像素集合中可能会被赋予一个或多个不同label,因此需要将这些属于同一个连通区域但具有不同值的label合并,即记录它们之间的相等关系;第二遍扫描就是将具有相等关系的equal_labels所标记的像素归为一个连通区域并赋予一个相同的label(通常这个label是equal_labels中的最小值)。The two-pass scanning method, as its name suggests, means that by scanning two images, all connected areas existing in the image can be found and marked. The main implementation idea is as follows: a label is given to each pixel position during the first scan, and one or more different labels may be assigned to the pixel set in the same connected area during the scanning process, so these need to be connected to the same one. Regions but labels with different values are merged, that is, the equality relationship between them is recorded; the second pass scan is to classify the pixels marked by equal_labels with equal relationship into one connected region and give the same label (usually this label is equal_labels) The minimum value).
种子填充方法来源于计算机图形学,常用于对某个图形进行填充。其主要实现思路为:选取一个前景像素点作为种子,然后根据连通区域的两个基本条件(像素值相同、位置相邻)将与种子相邻的前景像素合并到同一个像素集合中,最后得到的该像素集合则为一个连通区域。 The seed filling method is derived from computer graphics and is often used to fill a graphic. The main idea is to select a foreground pixel as a seed, and then merge the foreground pixels adjacent to the seed into the same pixel set according to the two basic conditions of the connected region (the pixel values are the same and the positions are adjacent). The set of pixels is a connected area.
连通区域中像素相邻关系主要有4邻域、8邻域,本申请实施例中采用4邻域分析所述优化后的二值图像中最大的连通区域。The pixel neighboring relationship in the connected area mainly has 4 neighborhoods and 8 neighborhoods. In the embodiment of the present application, the 4th neighborhood is used to analyze the largest connected area in the optimized binary image.
步骤160:使用预先训练的K近邻分类器判断所述最大的连通区域是否为手形,从而实现手势的识别。Step 160: Determine whether the largest connected area is a hand shape by using a pre-trained K-nearest neighbor classifier, thereby implementing recognition of a gesture.
K近邻分类器是一种很成熟的分类器,其原理是,如果与某个数据最近的M个数据中,第i个类的数据个数占多数,则此数据属于第i个类,其中的数据一般是一个向量,可以代表类的特征。The K-nearest neighbor classifier is a very mature classifier. The principle is that if the number of data of the i-th class is the majority of the M data closest to a certain data, the data belongs to the i-th class. The data is generally a vector that can represent the characteristics of the class.
预先训练K近邻分类器的关键是提取样本图片的特征,并根据这些特征将样本图片分为不同的类。本申请实施例选择了如下四个特征:The key to pre-training the K-nearest neighbor classifier is to extract the features of the sample pictures and classify the sample pictures into different classes based on these characteristics. The embodiment of the present application selects the following four features:
特征1:连通区域周长的平方与面积之比;Feature 1: Ratio of the square of the perimeter of the connected area to the area;
特征2:连通区域的面积;Feature 2: area of the connected area;
特征3:通过GMM(混合高斯模型)得到的连通区域像素属于皮肤区域的概率均值;Feature 3: the probability mean value of the connected region pixels obtained by the GMM (mixed Gaussian model) belonging to the skin region;
特征4:通过HSV直方图模型得到的连通区域像素属于皮肤去的概率均值;Feature 4: the mean probability of the connected region pixels obtained by the HSV histogram model belonging to the skin;
其中,特征3和特征4通过调用本申请实施例预先训练好的HSV直方图模型和GMM混合高斯模型进行计算,此处不赘述。The feature 3 and the feature 4 are calculated by calling the HSV histogram model and the GMM hybrid Gaussian model which are pre-trained in the embodiment of the present application, and are not described here.
本申请实施例中,预先训练的K近邻分类器,通过采用一定数量的手形和非手形的图片样本并计算其最大的连通区域的特征1~特征4,得到手区域和非手区域的样本。对于一幅待检测的连通图,提取上述特征1~特征4,基于这些样本的统计结果可判断所述连通图中是否包含人手区域。In the embodiment of the present application, the pre-trained K-nearest neighbor classifier obtains samples of the hand region and the non-hand region by using a certain number of hand-shaped and non-hand-shaped image samples and calculating features 1 to 4 of the largest connected region. For a connected graph to be detected, the above features 1 to 4 are extracted, and based on the statistical results of the samples, whether the human hand region is included in the connected graph can be determined.
其具体实现可以是这样:逐个判断待检测的连通图中特征1~特征4与K近邻分类器中的特征1~特征4的相似率,并为所述相似率设置一个合理的阈值,所述相似率大于所述阈值时,判断所述待检测的连通图中包含人手区域。The specific implementation may be such that the similarity ratios of the features 1 to 4 in the connectivity graph to the feature 1 to the feature 4 in the K neighbor neighbor classifier are determined one by one, and a reasonable threshold is set for the similarity rate. When the similarity ratio is greater than the threshold, it is determined that the connected graph to be detected includes a human hand region.
本实施中,通过对待检测的图像进行基于HSV直方图以及GMM模型检测,识别的所述待检测图像中的皮肤像素;进一步地,通过两种不同模型检测方式的综合运算以及滤波得到了所述待检测图像对应的优化后的二值图像;通过最大连通区域的分析以及K邻域分类器的判断,准确的实现了手形的识别,速度快且有效解决了现有技术中手形的误检测,从而间接提高了人机交互中手势识别的效率。 In this implementation, the skin pixels in the image to be detected are identified based on the HSV histogram and the GMM model detection by the image to be detected; further, the comprehensive operation and filtering of the two different model detection methods are used to obtain the The optimized binary image corresponding to the image to be detected; through the analysis of the maximum connected region and the judgment of the K neighborhood classifier, the hand shape recognition is accurately realized, and the speed detection and the error detection of the hand shape in the prior art are effectively solved. Thereby indirectly improving the efficiency of gesture recognition in human-computer interaction.
实施例二Embodiment 2
图2是本申请实施例二的技术流程图,结合图2,本申请实施例一种基于肤色的人手检测方法中,HSV直方图模型的训练主要由以下几个步骤实现:2 is a technical flowchart of the second embodiment of the present application. In conjunction with FIG. 2, in the human hand detection method based on skin color, the training of the HSV histogram model is mainly implemented by the following steps:
步骤210:对样本图像进行皮肤区域和非皮肤区域的标记,得到皮肤像素样本和非皮肤像素样本;Step 210: Perform marking of the skin region and the non-skin region on the sample image to obtain a skin pixel sample and a non-skin pixel sample;
样本的标记方式可以由人工完成以保证样本的高度准确性。The marking of the sample can be done manually to ensure a high degree of accuracy of the sample.
步骤220:将所述皮肤像素样本和所述非皮肤像素样本从RGB颜色空间转换到HSV颜色空间以获取皮肤HSV像素样本和非皮肤HSV像素样本;Step 220: Convert the skin pixel sample and the non-skin pixel sample from an RGB color space to an HSV color space to obtain a skin HSV pixel sample and a non-skin HSV pixel sample;
从RGB颜色空间转换到HSV颜色空间的具体实现公式及其技术效果如实施例一的步骤110所示,此处不再赘述。The specific implementation formula and the technical effect of the conversion from the RGB color space to the HSV color space are shown in step 110 of the first embodiment, and are not described herein again.
步骤230:统计所述皮肤HSV像素样本的HSV值,并根据所述皮肤HSV像素样本的HSV值的分布建立皮肤像素的HSV直方图模型;Step 230: Statistics the HSV value of the skin HSV pixel sample, and establish an HSV histogram model of the skin pixel according to the distribution of the HSV value of the skin HSV pixel sample;
本步骤中,对皮肤样本的像素点,分别统计其H值(色调)、S值(饱和度)、V值(亮度)的频率分布,从而建立皮肤像素的HSV直方图模型,与此同时对于非皮肤样本的像素点执行同样的操作。In this step, the frequency distribution of the H value (hue), S value (saturation), and V value (brightness) is separately calculated for the pixel points of the skin sample, thereby establishing an HSV histogram model of the skin pixel, and at the same time The same operation is performed on the pixels of the non-skin sample.
需要说明的是,本申请的核心在于,对所述HSV直方图模型的灰度级按照预设的比例关系进行压缩以得到优化的直方图统计效果。It should be noted that the core of the present application is that the gray level of the HSV histogram model is compressed according to a preset proportional relationship to obtain an optimized histogram statistical effect.
H、S和V通道各有256个灰度级,如果使用所有的灰度级则直方图的长度为224,大约为1600万,这在样本数量不足够大时无法得到好的统计效果。因此,本申请实施例对直方图长度进行了压缩,其压缩的比例可以根据经验进行选择。本实施例中,按照4:2:1的比例将H通道压缩64个灰度级,将S通道压缩为32个灰度级,将V通道压缩为16个灰度级,压缩之后的直方图长度为215,即65536。HSV三个通道使用了不同数量的灰度级,因为HSV三个通道受光照强度的影响程度不同,H(色度)通道不受光照变化影响,V通道正比于光照强度变化,S通道受光照的影响程度介于二者之间。H, S and V channels each have 256 gray levels, if all of the gray level histogram of length 224, is approximately 16 million, this effect can not be obtained when good statistical sample size is not large enough. Therefore, the embodiment of the present application compresses the length of the histogram, and the ratio of compression can be selected according to experience. In this embodiment, the H channel is compressed by 64 gray levels in a ratio of 4:2:1, the S channel is compressed to 32 gray levels, and the V channel is compressed to 16 gray levels, and the histogram after compression. The length is 2 15 , which is 65536. The HSV uses three different gray levels for the three channels, because the three channels of HSV are affected by the light intensity, the H (chrominance) channel is not affected by the illumination change, the V channel is proportional to the change of the light intensity, and the S channel is illuminated. The degree of influence is somewhere in between.
通过对直方图灰度级的压缩,即使在少量样本的情况下也能进行高准确率的肤色检测。By compressing the gray level of the histogram, high-accuracy skin color detection can be performed even in the case of a small number of samples.
步骤240:统计所述非皮肤HSV像素样本的HSV值,并根据所述非皮肤HSV 像素样本的HSV值的分布建立非皮肤像素的HSV直方图模型。Step 240: Statistics the HSV value of the non-skin HSV pixel sample, and according to the non-skin HSV The distribution of HSV values for pixel samples establishes an HSV histogram model of non-skin pixels.
对非皮肤像素样本建立HSV直方图模型的执行过程及技术效果同上述步骤230,此处不做赘述。需要说明的是,步骤230和步骤240实际并无先后顺序,本申请实施例不做不限制。The execution process and technical effect of establishing the HSV histogram model for the non-skin pixel samples are the same as the above step 230, and will not be described here. It should be noted that there is no actual order in the step 230 and the step 240. The embodiment of the present application is not limited.
本实施例中,通过对皮肤样本和非皮肤样本的训练以及HSV直方图灰度级的压缩分别建立了皮肤像素和非皮肤像素的HSV直方图模型,即使训练样本数量较少,也能极大降低皮肤像素的误检率。In this embodiment, the HSV histogram model of the skin pixel and the non-skin pixel is respectively established by training the skin sample and the non-skin sample and compressing the gray level of the HSV histogram, even if the number of training samples is small, Reduce the false detection rate of skin pixels.
实施例三Embodiment 3
图3是本申请实施例三的技术流程图,结合图2,本申请实施例一种基于肤色的人手检测方法中,混合高斯模型(GMM)的建立主要包括如下的步骤:3 is a technical flowchart of Embodiment 3 of the present application. In conjunction with FIG. 2, in a human hand detection method based on skin color, the establishment of a mixed Gaussian model (GMM) mainly includes the following steps:
步骤310:对RGB样本图片的皮肤像素区域和非皮肤像素区域进行标记,得到皮肤像素样本和非皮肤像素样本;Step 310: Mark a skin pixel area and a non-skin pixel area of the RGB sample picture to obtain a skin pixel sample and a non-skin pixel sample.
本申请实施例中,首先对RGB样本图片进行标记,可以是人工的,用以区分出图片中的皮肤区域和非皮肤区域,即得到皮肤像素样本和非皮肤像素样本。预先对样本进行分类,有助于提高后续EM算法在计算混合高斯模型参数的效率以及参数与实际模型的接近程度。In the embodiment of the present application, the RGB sample picture is first marked, which may be artificial, to distinguish the skin area and the non-skin area in the picture, that is, the skin pixel sample and the non-skin pixel sample are obtained. Pre-classifying the samples helps to improve the efficiency of the subsequent EM algorithm in calculating the parameters of the mixed Gaussian model and how close the parameters are to the actual model.
步骤320:将所述皮肤像素样本和非皮肤像素样本由RGB颜色空间转换到r-g颜色空间;Step 320: Convert the skin pixel sample and the non-skin pixel sample from an RGB color space to an r-g color space;
本步骤中的转换方式同实施例一中描述的相同,采用如下公式:The conversion method in this step is the same as that described in the first embodiment, and the following formula is adopted:
Figure PCTCN2016096982-appb-000011
Figure PCTCN2016096982-appb-000011
Figure PCTCN2016096982-appb-000012
Figure PCTCN2016096982-appb-000012
b=1-g-rb=1-g-r
其中,R为所述像素点的红色值、G为所述像素点的绿色值、B为所述像素点的蓝色值;r、g、b分别为转化后所述像素点对应的颜色值。Where R is the red value of the pixel, G is the green value of the pixel, B is the blue value of the pixel; r, g, b are the color values corresponding to the pixel after conversion .
步骤330:使用期望最大化算法,根据颜色空间转化后的所述皮肤像素样本和非皮肤像素样本分别计算出所述皮肤像素混合高斯模型和所述非皮肤像素混 合高斯模型的参数,其中,所述参数包括ak、Sk和πkStep 330: Calculate parameters of the skin pixel mixed Gaussian model and the non-skin pixel mixed Gaussian model according to the skin space converted skin sample and the non-skin pixel sample, respectively, using an expectation maximization algorithm. The parameters include a k , S k and π k .
混合高斯模型是多个单高斯模型的叠加,在混合高斯模型中,每个单高斯模型的权重不相同,即混合高斯模型中的数据是从几个单高斯模型中生成的。单高斯模型的个数K需要预先设置,πk即是每个单高斯模型的权重。The mixed Gaussian model is a superposition of multiple single Gaussian models. In the mixed Gaussian model, the weight of each single Gaussian model is different, that is, the data in the mixed Gaussian model is generated from several single Gaussian models. The number K of the single Gaussian model needs to be set in advance, and π k is the weight of each single Gaussian model.
在统计计算中,期望最大化(EM)算法是在概率(probabilistic)模型中寻找参数最大似然估计或者最大后验估计的算法,其中概率模型依赖于无法观测的隐藏变量(Latent Variable)。当有部分数据缺失或者无法观察到时,EM算法提供了一个高效的迭代程序用来计算这些数据的最大似然估计。在每一步迭代分为两个步骤:期望(Expectation)步骤和最大化(Maximization)步骤,因此称为EM算法。EM算法是非常成熟的算法且推导过程复杂,本申请实施例不作详述。In statistical calculations, the Expectation Maximization (EM) algorithm is an algorithm for finding a parameter maximum likelihood estimate or a maximum a posteriori estimate in a probabilistic model, where the probability model relies on an unobservable hidden variable. When some data is missing or unobservable, the EM algorithm provides an efficient iterative procedure to calculate the maximum likelihood estimate for these data. The iteration is divided into two steps at each step: the Expectation step and the Maximization step, hence the EM algorithm. The EM algorithm is a very mature algorithm and the derivation process is complicated, which is not described in detail in the embodiment of the present application.
步骤340:根据混合高斯模型公式建立混合高斯模型。Step 340: Establish a mixed Gaussian model according to the mixed Gaussian model formula.
根据标记后的皮肤像素样本,结合EM算法,可以计算出皮肤混合高斯模型的均值向量ak1、协方差矩阵Sk1以及多个单高斯模型分别对应的权重πk1,代入混合高斯模型公式,可以得到皮肤混合高斯模型为:According to the labeled skin pixel samples, combined with the EM algorithm, the mean vector a k1 of the skin mixed Gaussian model, the covariance matrix S k1 and the weights π k1 corresponding to the multiple single Gaussian models can be calculated and substituted into the mixed Gaussian model formula. Get the skin mixed Gaussian model as:
Figure PCTCN2016096982-appb-000013
Figure PCTCN2016096982-appb-000013
根据标记后的非皮肤像素样本,结合EM算法,可以计算出非皮肤混合高斯模型的均值向量ak2、协方差矩阵Sk2以及多个单高斯模型分别对应的权重πk2,得到的非皮肤混合高斯模型为:According to the labeled non-skin pixel samples, combined with the EM algorithm, the mean vector a k2 of the non-skin mixed Gaussian model, the covariance matrix S k2 , and the weights π k2 corresponding to the plurality of single Gaussian models respectively can be calculated, and the obtained non-skin mixture is obtained. The Gaussian model is:
Figure PCTCN2016096982-appb-000014
Figure PCTCN2016096982-appb-000014
当读取到一幅新的待检测图片时,在颜色空间变换后读取所述待检测图片的每一像素点并将所述像素点代入上述两个模型,分别计算所述像素点的pskin和pnon-skinWhen a new picture to be detected is read, each pixel of the picture to be detected is read after the color space is transformed, and the pixel is substituted into the two models, and the pixel points are respectively calculated. Skin and p non-skin .
本实施例中,通过对少量样本图片的皮肤区域与非皮肤区域进行标记,辅以EM算法建立皮肤像素与非皮肤像素的混合高斯模型,与现有技术中基于直方图进 行肤色检测相比,并不需要大量训练样本,节省了各种资源的消耗,提高了肤色检测的效率。In this embodiment, by combining the skin area and the non-skin area of a small number of sample pictures, the EM algorithm is used to establish a mixed Gaussian model of skin pixels and non-skin pixels, and the prior art based on the histogram Compared with skin color detection, a large number of training samples are not needed, which saves various resource consumption and improves the efficiency of skin color detection.
需要说明的是,本申请实施例中,HSV直方图模型的建立和混合高斯模型的建立并无先后顺序,待检测图片与上述两个模型中的任一个模型之间的匹配过程也无先后顺序。本申请各个实施例的布局仅为了阐述两个模型的各自建立过程,对其建立的顺序的使用的顺序不做任何限制。It should be noted that, in the embodiment of the present application, the establishment of the HSV histogram model and the establishment of the mixed Gaussian model are not sequential, and the matching process between the image to be detected and any of the above two models is also in no order. . The layout of the various embodiments of the present application is merely illustrative of the respective establishment processes of the two models, and the order of use of the order in which they are established is not limited.
最后需要说明的是,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一非暂态计算机可读存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的非暂态计算机可读存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(RandomAccessMemory,RAM)等。Finally, it should be understood that those skilled in the art can understand that all or part of the process of implementing the above embodiments can be completed by a computer program to instruct related hardware, and the program can be stored in a non-transitory computer. In a readable storage medium, the program, when executed, may include the flow of an embodiment of the methods as described above. The non-transitory computer readable storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
实施例四Embodiment 4
图4是本申请实施例4的技术流程图,结合图4,本申请一种基于肤色的人手检测方法主要包括以下几个大的模块:图像转换模块410、二值图获取模块420、按位运算模块430、滤波模块440、连通区域判断模块450、模型训练模块460。4 is a technical flowchart of Embodiment 4 of the present application. Referring to FIG. 4, a human hand detection method based on skin color mainly includes the following large modules: an image conversion module 410, a binary image acquisition module 420, and a bitwise position. The arithmetic module 430, the filtering module 440, the connected area determining module 450, and the model training module 460.
所述图像转换模块410,用于将获取到的待检测图像从RGB颜色空间转换到HSV颜色空间以获取HSV图像,并将所述待检测图像从RGB颜色空间转换到r-g颜色空间以获取r-g图像;The image conversion module 410 is configured to convert the acquired image to be detected from an RGB color space to an HSV color space to acquire an HSV image, and convert the image to be detected from an RGB color space to an rg color space to obtain an rg image. ;
所述二值图获取模块420,用于遍历读取所述HSV图像中的每一像素点,并调用所述模型训练模块460预先建立的HSV直方图模型将所述HSV图像转化为第一二值图像,并遍历读取所述r-g图像中的每一像素点,调用所述模型训练模块预先建立的混合高斯模型将所述r-g图像转化为第二二值图像;The binary map obtaining module 420 is configured to traverse each pixel in the HSV image and call the HSV histogram model pre-established by the model training module 460 to convert the HSV image into the first two a value image, and traversing each pixel point in the rg image, calling a mixed Gaussian model pre-established by the model training module to convert the rg image into a second binary image;
所述按位运算模块430,用于对所述第一二值图像和所述第二二值图像进行按位与运算从而获得综合二值图像;The bitwise operation module 430 is configured to perform a bitwise AND operation on the first binary image and the second binary image to obtain a comprehensive binary image;
所述滤波模块440,用于对所述综合二值图像进行滤波以获取优化后的二值图像;The filtering module 440 is configured to filter the integrated binary image to obtain an optimized binary image;
所述连通区域判断模块450,用于分析所述优化后的二值图像中最大的连通区域,将所述最大的连通区域作为皮肤区域。 The connected area determining module 450 is configured to analyze a largest connected area in the optimized binary image, and use the largest connected area as a skin area.
具体地,所述模型训练模块460用于:Specifically, the model training module 460 is configured to:
对样本图像进行皮肤区域和非皮肤区域的标记,得到皮肤像素样本和非皮肤像素样本;Marking the skin image and the non-skin area of the sample image to obtain a skin pixel sample and a non-skin pixel sample;
调用所述图像转换模块410将所述皮肤像素样本和所述非皮肤像素样本从RGB颜色空间转换到HSV颜色空间以获取皮肤HSV像素样本和非皮肤HSV像素样本;Invoking the image conversion module 410 to convert the skin pixel sample and the non-skin pixel sample from an RGB color space to an HSV color space to obtain a skin HSV pixel sample and a non-skin HSV pixel sample;
统计所述皮肤HSV像素样本的HSV值,并根据所述皮肤HSV像素样本的HSV值的分布建立皮肤像素的HSV直方图模型;Calculating an HSV value of the skin HSV pixel sample, and establishing an HSV histogram model of the skin pixel according to a distribution of HSV values of the skin HSV pixel sample;
统计所述非皮肤HSV像素样本的HSV值,并根据所述非皮肤HSV像素样本的HSV值的分布建立非皮肤像素的HSV直方图模型;Counting an HSV value of the non-skin HSV pixel sample, and establishing an HSV histogram model of the non-skin pixel according to a distribution of HSV values of the non-skin HSV pixel sample;
具体地,所述模型训练模块460还用于:Specifically, the model training module 460 is further configured to:
调用所述图像转换模块410将所述皮肤像素样本和非皮肤像素样本由RGB颜色空间转换到r-g颜色空间得到r-g皮肤像素样本和r-g非皮肤像素样本;Calling the image conversion module 410 to convert the skin pixel sample and the non-skin pixel sample from the RGB color space to the r-g color space to obtain an r-g skin pixel sample and an r-g non-skin pixel sample;
使用期望最大化算法,根据所述r-g皮肤像素样本和所述r-g非皮肤像素样本分别计算出所述皮肤像素混合高斯模型和所述非皮肤像素混合高斯模型的参数从而建立所述皮肤像素混合高斯模型和所述非皮肤像素混合高斯模型,其中,所述参数包括混合高斯模型中每个高斯模型的均值向量、协方差矩阵以及权重。Calculating parameters of the skin pixel mixed Gaussian model and the non-skin pixel mixed Gaussian model according to the rg skin pixel sample and the rg non-skin pixel sample, respectively, using an expectation maximization algorithm to establish the skin pixel hybrid Gauss The model and the non-skin pixel mixed Gaussian model, wherein the parameters include a mean vector, a covariance matrix, and a weight of each Gaussian model in the mixed Gaussian model.
具体地,所述二值图获取模块420,进一步用于:Specifically, the binary map obtaining module 420 is further configured to:
读取所述像素点的HSV值,计算所述HSV值分别与所述皮肤像素的HSV直方图模型以及所述非皮肤像素的HSV直方图模型的匹配概率值,并根据所述匹配程度值判断所述像素点是否属于皮肤区域;Reading an HSV value of the pixel, calculating a matching probability value of the HSV value with an HSV histogram model of the skin pixel and an HSV histogram model of the non-skin pixel, respectively, and determining according to the matching degree value Whether the pixel points belong to a skin area;
若所述像素点属于皮肤区域,则以x为所述像素点赋值,若所述像素点属于皮肤区域,则以y为所述像素点赋值,从而得到所述第一二值图像;If the pixel belongs to the skin region, the pixel is assigned with x, and if the pixel belongs to the skin region, the pixel is assigned with y, thereby obtaining the first binary image;
所述二值图获取模块420,进一步还用于:The binary map obtaining module 420 is further configured to:
计算所述像素点在皮肤混合高斯模型下的第一概率密度以及所述像素点在非皮肤混合高斯模型下的第二概率密度;Calculating a first probability density of the pixel point under a skin-mixed Gaussian model and a second probability density of the pixel point under a non-skin mixed Gaussian model;
根据所述像素点的所述第一概率密度和所述第二概率密度计算所述像素点属于皮肤区域的后验概率; Calculating a posterior probability that the pixel belongs to a skin region according to the first probability density of the pixel point and the second probability density;
当判定所述后验概率大于预设的后验概率阈值时,将所述像素点归属于皮肤区域;When the posterior probability is determined to be greater than a preset posterior probability threshold, the pixel point is attributed to the skin region;
若所述像素点属于皮肤区域,则以x为所述像素点赋值,若所述像素点不属于皮肤区域,则以y为所述像素点赋值,从而得到所述第一二值图像和所述第二二值图像。If the pixel belongs to the skin region, the pixel is assigned with x, and if the pixel does not belong to the skin region, the pixel is assigned with y, thereby obtaining the first binary image and the The second binary image is described.
具体地,连通区域判断模块450,进一步用于:Specifically, the connected area determining module 450 is further configured to:
使用预先训练的K近邻分类器判断所述最大的连通区域是否为手形,从而实现手势的识别。The pre-trained K-nearest neighbor classifier is used to determine whether the largest connected area is a hand shape, thereby realizing recognition of a gesture.
图4对应的实施例的执行过程及技术效果与图1、图2、图3对应的实施例相同,此处不再赘述。The implementation process and technical effects of the embodiment corresponding to FIG. 4 are the same as those of the embodiment corresponding to FIG. 1, FIG. 2, and FIG. 3, and details are not described herein again.
在本申请另一实施例中,还提供一种电子设备,包括前述任一实施例所述的基于肤色的人手检测装置。In another embodiment of the present application, there is also provided an electronic device comprising the skin color based human hand detecting device according to any of the preceding embodiments.
在本申请另一实施例中,还提供一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储有计算机可执行指令,该计算机可执行指令可执行上述任意方法实施例中的基于肤色的人手检测方法。In another embodiment of the present application, a non-transitory computer readable storage medium is also provided, the non-transitory computer readable storage medium storing computer executable instructions executable by any of the above methods The skin color based human hand detection method in the example.
图5是本申请实施例提供的执行基于肤色的人手检测方法的电子设备的硬件结构示意图,如图5所示,该设备包括:FIG. 5 is a schematic diagram of a hardware structure of an electronic device for performing a skin-based human hand detection method according to an embodiment of the present application. As shown in FIG. 5, the device includes:
一个或多个处理器510以及存储器520,图5中以一个处理器510为例。One or more processors 510 and memory 520, one processor 510 is taken as an example in FIG.
执行基于肤色的人手检测方法的设备还可以包括:输入装置530和输出装置440。The apparatus for performing the skin color based human hand detection method may further include: an input device 530 and an output device 440.
处理器510、存储器520、输入装置530和输出装置540可以通过总线或者其他方式连接,图5中以通过总线连接为例。The processor 510, the memory 520, the input device 530, and the output device 540 may be connected by a bus or other means, as exemplified by a bus connection in FIG.
存储器520作为一种非暂态计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块,如本申请实施例中的基于肤色的人手检测方法对应的程序指令/模块(例如,附图4所示的图像转换模块410、二值图获取模块420、按位运算模块430、滤波模块440、连通区域判断模块450、和模型训练模块460)。处理器510通过运行存储在存储器520中的非易失性软件程序、指令以及模块,从而执行电子设备的各种功能应用以及数据处理,即实现上 述方法实施例基于肤色的人手检测方法。The memory 520 is used as a non-transitory computer readable storage medium, and can be used for storing a non-volatile software program, a non-volatile computer executable program, and a module, such as a skin-based human hand detection method in the embodiment of the present application. Program instructions/modules (for example, image conversion module 410, binary image acquisition module 420, bitwise operation module 430, filter module 440, connected region determination module 450, and model training module 460 shown in FIG. 4). The processor 510 executes various functional applications and data processing of the electronic device by running non-volatile software programs, instructions, and modules stored in the memory 520, that is, on the implementation. The method embodiment is based on a human hand detection method of skin color.
存储器520可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据基于肤色的人手检测装置的使用所创建的数据等。此外,存储器520可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实施例中,存储器520可选包括相对于处理器510远程设置的存储器,这些远程存储器可以通过网络连接至基于肤色的人手检测装置。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 520 may include a storage program area and an storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to use of the skin color-based human hand detection device, and the like. . Further, the memory 520 may include a high speed random access memory, and may also include a nonvolatile memory such as at least one magnetic disk storage device, flash memory device, or other nonvolatile solid state storage device. In some embodiments, memory 520 can optionally include a memory remotely located relative to processor 510 that can be connected to a skin tone based hand detection device over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
输入装置530可接收输入的数字或字符信息,以及产生与基于肤色的人手检测装置的用户设置以及功能控制有关的键信号输入。输出装置540可包括显示屏等显示设备。The input device 530 can receive input numeric or character information and generate key signal inputs related to user settings and function control of the skin tone based hand detection device. The output device 540 can include a display device such as a display screen.
所述一个或者多个模块存储在所述存储器520中,当被所述一个或者多个处理器510执行时,执行上述任意方法实施例中的基于肤色的人手检测方法。The one or more modules are stored in the memory 520, and when executed by the one or more processors 510, perform a skin tone based human hand detection method in any of the above method embodiments.
上述产品可执行本申请实施例所提供的方法,具备执行方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,可参见本申请实施例所提供的方法。The above products can perform the methods provided by the embodiments of the present application, and have the corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to the method provided by the embodiments of the present application.
本申请实施例的电子设备以多种形式存在,包括但不限于:The electronic device of the embodiment of the present application exists in various forms, including but not limited to:
(1)移动通信设备:这类设备的特点是具备移动通信功能,并且以提供话音、数据通信为主要目标。这类终端包括:智能手机(例如iPhone)、多媒体手机、功能性手机,以及低端手机等。(1) Mobile communication devices: These devices are characterized by mobile communication functions and are mainly aimed at providing voice and data communication. Such terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
(2)超移动个人计算机设备:这类设备属于个人计算机的范畴,有计算和处理功能,一般也具备移动上网特性。这类终端包括:PDA、MID和UMPC设备等,例如iPad。(2) Ultra-mobile personal computer equipment: This type of equipment belongs to the category of personal computers, has computing and processing functions, and generally has mobile Internet access. Such terminals include: PDAs, MIDs, and UMPC devices, such as the iPad.
(3)便携式娱乐设备:这类设备可以显示和播放多媒体内容。该类设备包括:音频、视频播放器(例如iPod),掌上游戏机,电子书,以及智能玩具和便携式车载导航设备。(3) Portable entertainment devices: These devices can display and play multimedia content. Such devices include: audio, video players (such as iPod), handheld game consoles, e-books, and smart toys and portable car navigation devices.
(4)服务器:提供计算服务的设备,服务器的构成包括处理器、硬盘、内存、系统总线等,服务器和通用的计算机架构类似,但是由于需要提供高可靠的服务, 因此在处理能力、稳定性、可靠性、安全性、可扩展性、可管理性等方面要求较高。(4) Server: A device that provides computing services. The server consists of a processor, a hard disk, a memory, a system bus, etc. The server is similar to a general-purpose computer architecture, but due to the need to provide highly reliable services, Therefore, it is highly demanded in terms of processing power, stability, reliability, security, scalability, and manageability.
(5)其他具有数据交互功能的电子装置。(5) Other electronic devices with data interaction functions.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机装置(可以是个人计算机,服务器,或者网络装置等)执行各个实施例或者实施例的某些部分所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the various embodiments can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware. Based on such understanding, the above-described technical solutions may be embodied in the form of software products in essence or in the form of software products, which may be stored in a computer readable storage medium such as ROM/RAM, magnetic Discs, discs, etc., include instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments or portions of the embodiments.
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。 Finally, it should be noted that the above embodiments are only used to explain the technical solutions of the present application, and are not limited thereto; although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still The technical solutions described in the foregoing embodiments are modified, or the equivalents of the technical features are replaced by the equivalents. The modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (13)

  1. 一种基于肤色的人手检测方法,其特征在于,应用于电子设备,包括如下的步骤:A human skin detection method based on skin color, characterized in that it is applied to an electronic device, comprising the following steps:
    将获取到的待检测图像从RGB颜色空间转换到HSV颜色空间以获取HSV图像,并将所述待检测图像从RGB颜色空间转换到r-g颜色空间以获取r-g图像;Converting the acquired image to be detected from the RGB color space to the HSV color space to obtain an HSV image, and converting the image to be detected from the RGB color space to the r-g color space to obtain an r-g image;
    遍历读取所述HSV图像中的每一像素点,并根据预先建立的HSV直方图模型将所述HSV图像转化为第一二值图像,并遍历读取所述r-g图像中的每一像素点,根据预先建立的混合高斯模型将所述r-g图像转化为第二二值图像;Traversing each pixel in the HSV image and converting the HSV image into a first binary image according to a pre-established HSV histogram model, and traversing each pixel in the rg image Converting the rg image into a second binary image according to a pre-established mixed Gaussian model;
    对所述第一二值图像和所述第二二值图像进行按位与运算从而获得综合二值图像;Performing a bitwise AND operation on the first binary image and the second binary image to obtain a comprehensive binary image;
    对所述综合二值图像进行滤波以获取优化后的二值图像;Filtering the integrated binary image to obtain an optimized binary image;
    分析所述优化后的二值图像中最大的连通区域,将所述最大的连通区域作为皮肤区域;Analyzing a maximum connected area in the optimized binary image, and using the largest connected area as a skin area;
    使用预先训练的K近邻分类器判断所述最大的连通区域是否为手形,从而实现人手的识别。The pre-trained K-nearest neighbor classifier is used to determine whether the largest connected area is a hand shape, thereby realizing human hand recognition.
  2. 根据权利要求1所述的方法,其特征在于,根据预先建立的HSV直方图模型将所述HSV图像转化为第一二值图像,进一步包括:The method according to claim 1, wherein converting the HSV image into a first binary image according to a pre-established HSV histogram model further comprises:
    对样本图像进行皮肤区域和非皮肤区域的标记,得到皮肤像素样本和非皮肤像素样本;Marking the skin image and the non-skin area of the sample image to obtain a skin pixel sample and a non-skin pixel sample;
    将所述皮肤像素样本和所述非皮肤像素样本从RGB颜色空间转换到HSV颜色空间以获取皮肤HSV像素样本和非皮肤HSV像素样本;Converting the skin pixel sample and the non-skin pixel sample from an RGB color space to an HSV color space to obtain a skin HSV pixel sample and a non-skin HSV pixel sample;
    统计所述皮肤HSV像素样本的HSV值,并根据所述皮肤HSV像素样本的HSV值的分布建立皮肤像素的HSV直方图模型;Calculating an HSV value of the skin HSV pixel sample, and establishing an HSV histogram model of the skin pixel according to a distribution of HSV values of the skin HSV pixel sample;
    统计所述非皮肤HSV像素样本的HSV值,并根据所述非皮肤HSV像素样本的HSV值的分布建立非皮肤像素的HSV直方图模型。The HSV values of the non-skin HSV pixel samples are counted, and an HSV histogram model of non-skin pixels is established based on the distribution of HSV values of the non-skin HSV pixel samples.
  3. 根据权利要求1或2所述的方法,其特征在于,根据预先建立的HSV 直方图模型将所述HSV图像转化为第一二值图像,进一步包括:Method according to claim 1 or 2, characterized in that it is based on a pre-established HSV The histogram model converts the HSV image into a first binary image, further comprising:
    读取所述像素点的HSV值,计算所述HSV值分别与所述皮肤像素的HSV直方图模型以及所述非皮肤像素的HSV直方图模型的匹配概率值,并根据所述匹配程度值判断所述像素点是否属于皮肤区域;Reading an HSV value of the pixel, calculating a matching probability value of the HSV value with an HSV histogram model of the skin pixel and an HSV histogram model of the non-skin pixel, respectively, and determining according to the matching degree value Whether the pixel points belong to a skin area;
    若所述像素点属于皮肤区域,则以x为所述像素点赋值,若所述像素点不属于皮肤区域,则以y为所述像素点赋值,从而得到所述第一二值图像。If the pixel belongs to the skin region, the pixel is assigned with x, and if the pixel does not belong to the skin region, the pixel is assigned with y, thereby obtaining the first binary image.
  4. 根据权利要求1所述的方法,其特征在于,根据预先建立的混合高斯模型将所述r-g图像转化为第二二值图像,进一步包括:The method according to claim 1, wherein converting the r-g image into a second binary image according to a pre-established mixed Gaussian model further comprises:
    对RGB样本图片的皮肤像素区域和非皮肤像素区域进行标记,得到皮肤像素样本和非皮肤像素样本;Marking the skin pixel area and the non-skin pixel area of the RGB sample picture to obtain a skin pixel sample and a non-skin pixel sample;
    将所述皮肤像素样本和非皮肤像素样本由RGB颜色空间转换到r-g颜色空间得到r-g皮肤像素样本和r-g非皮肤像素样本;Converting the skin pixel sample and the non-skin pixel sample from an RGB color space to an r-g color space to obtain an r-g skin pixel sample and an r-g non-skin pixel sample;
    使用期望最大化算法,根据所述r-g皮肤像素样本和所述r-g非皮肤像素样本分别计算出所述皮肤像素混合高斯模型和所述非皮肤像素混合高斯模型的参数从而建立所述皮肤像素混合高斯模型和所述非皮肤像素混合高斯模型,其中,所述参数包括混合高斯模型中每个高斯模型的均值向量、协方差矩阵以及权重。Calculating parameters of the skin pixel mixed Gaussian model and the non-skin pixel mixed Gaussian model according to the rg skin pixel sample and the rg non-skin pixel sample, respectively, using an expectation maximization algorithm to establish the skin pixel hybrid Gauss The model and the non-skin pixel mixed Gaussian model, wherein the parameters include a mean vector, a covariance matrix, and a weight of each Gaussian model in the mixed Gaussian model.
  5. 根据权利要求1或4所述的方法,其特征在于,根据预先建立的混合高斯模型将所述HSV图像转化为第二二值图像,进一步包括:The method according to claim 1 or 4, wherein converting the HSV image into a second binary image according to a pre-established mixed Gaussian model further comprises:
    计算所述像素点在皮肤混合高斯模型下的第一概率密度以及所述像素点在非皮肤混合高斯模型下的第二概率密度;Calculating a first probability density of the pixel point under a skin-mixed Gaussian model and a second probability density of the pixel point under a non-skin mixed Gaussian model;
    根据所述像素点的所述第一概率密度和所述第二概率密度计算所述像素点属于皮肤区域的后验概率;Calculating a posterior probability that the pixel belongs to a skin region according to the first probability density of the pixel point and the second probability density;
    当判定所述后验概率大于预设的后验概率阈值时,将所述像素点归属于皮肤区域;When the posterior probability is determined to be greater than a preset posterior probability threshold, the pixel point is attributed to the skin region;
    若所述像素点属于皮肤区域,则以x为所述像素点赋值,若所述像素点不属于皮肤区域,则以y为所述像素点赋值,从而得到所述第一二值图像和所述第二二值图像。If the pixel belongs to the skin region, the pixel is assigned with x, and if the pixel does not belong to the skin region, the pixel is assigned with y, thereby obtaining the first binary image and the The second binary image is described.
  6. 一种基于肤色的人手检测装置,其特征在于,包括如下的模块: A human skin detecting device based on skin color, comprising the following modules:
    图像转换模块,用于将获取到的待检测图像从RGB颜色空间转换到HSV颜色空间以获取HSV图像,并将所述待检测图像从RGB颜色空间转换到r-g颜色空间以获取r-g图像;An image conversion module, configured to convert the acquired image to be detected from an RGB color space to an HSV color space to acquire an HSV image, and convert the image to be detected from an RGB color space to an r-g color space to obtain an r-g image;
    二值图获取模块,用于遍历读取所述HSV图像中的每一像素点,并根据预先建立的HSV直方图模型将所述HSV图像转化为第一二值图像,并遍历读取所述r-g图像中的每一像素点,根据预先建立的混合高斯模型将所述r-g图像转化为第二二值图像;a binary map obtaining module, configured to traverse each pixel in the HSV image, and convert the HSV image into a first binary image according to a pre-established HSV histogram model, and traverse the read Each pixel in the rg image converts the rg image into a second binary image according to a pre-established mixed Gaussian model;
    按位运算模块,用于对所述第一二值图像和所述第二二值图像进行按位与运算从而获得综合二值图像;a bitwise operation module, configured to perform a bitwise AND operation on the first binary image and the second binary image to obtain a comprehensive binary image;
    滤波模块,用于对所述综合二值图像进行滤波以获取优化后的二值图像;a filtering module, configured to filter the integrated binary image to obtain an optimized binary image;
    连通区域判断模块,用于分析所述优化后的二值图像中最大的连通区域,将所述最大的连通区域作为皮肤区域;a connected area judging module, configured to analyze a largest connected area in the optimized binary image, and use the largest connected area as a skin area;
    人手识别模块,用于使用预先训练的K近邻分类器判断所述最大的连通区域是否为手形,从而实现人手的识别。The human hand identification module is configured to determine whether the maximum connected area is a hand shape using a pre-trained K-nearest neighbor classifier, thereby realizing human hand recognition.
  7. 根据权利要求6所述的装置,其特征在于,所述装置进一步包括模型训练模块,所述模型训练模块用于:The apparatus of claim 6 wherein said apparatus further comprises a model training module, said model training module for:
    对样本图像进行皮肤区域和非皮肤区域的标记,得到皮肤像素样本和非皮肤像素样本;Marking the skin image and the non-skin area of the sample image to obtain a skin pixel sample and a non-skin pixel sample;
    将所述皮肤像素样本和所述非皮肤像素样本从RGB颜色空间转换到HSV颜色空间以获取皮肤HSV像素样本和非皮肤HSV像素样本;Converting the skin pixel sample and the non-skin pixel sample from an RGB color space to an HSV color space to obtain a skin HSV pixel sample and a non-skin HSV pixel sample;
    统计所述皮肤HSV像素样本的HSV值,并根据所述皮肤HSV像素样本的HSV值的分布建立皮肤像素的HSV直方图模型;Calculating an HSV value of the skin HSV pixel sample, and establishing an HSV histogram model of the skin pixel according to a distribution of HSV values of the skin HSV pixel sample;
    统计所述非皮肤HSV像素样本的HSV值,并根据所述非皮肤HSV像素样本的HSV值的分布建立非皮肤像素的HSV直方图模型。The HSV values of the non-skin HSV pixel samples are counted, and an HSV histogram model of non-skin pixels is established based on the distribution of HSV values of the non-skin HSV pixel samples.
  8. 根据权利要求6所述的装置,其特征在于,所述装置进一步包括模型训练模块,所述模型训练模块还用于:The device according to claim 6, wherein the device further comprises a model training module, wherein the model training module is further configured to:
    将所述皮肤像素样本和非皮肤像素样本由RGB颜色空间转换到r-g颜色空间得到r-g皮肤像素样本和r-g非皮肤像素样本; Converting the skin pixel sample and the non-skin pixel sample from an RGB color space to an r-g color space to obtain an r-g skin pixel sample and an r-g non-skin pixel sample;
    使用期望最大化算法,根据所述r-g皮肤像素样本和所述r-g非皮肤像素样本分别计算出所述皮肤像素混合高斯模型和所述非皮肤像素混合高斯模型的参数从而建立所述皮肤像素混合高斯模型和所述非皮肤像素混合高斯模型,其中,所述参数包括混合高斯模型中每个高斯模型的均值向量、协方差矩阵以及权重。Calculating parameters of the skin pixel mixed Gaussian model and the non-skin pixel mixed Gaussian model according to the rg skin pixel sample and the rg non-skin pixel sample, respectively, using an expectation maximization algorithm to establish the skin pixel hybrid Gauss The model and the non-skin pixel mixed Gaussian model, wherein the parameters include a mean vector, a covariance matrix, and a weight of each Gaussian model in the mixed Gaussian model.
  9. 根据权利要求6或7所述的装置,其特征在于,所述二值图获取模块,进一步用于:The apparatus according to claim 6 or 7, wherein the binary map obtaining module is further configured to:
    读取所述像素点的HSV值,计算所述HSV值分别与所述皮肤像素的HSV直方图模型以及所述非皮肤像素的HSV直方图模型的匹配概率值,并根据所述匹配程度值判断所述像素点是否属于皮肤区域;Reading an HSV value of the pixel, calculating a matching probability value of the HSV value with an HSV histogram model of the skin pixel and an HSV histogram model of the non-skin pixel, respectively, and determining according to the matching degree value Whether the pixel points belong to a skin area;
    若所述像素点属于皮肤区域,则以x为所述像素点赋值,若所述像素点不属于皮肤区域,则以y为所述像素点赋值,从而得到所述第一二值图像。If the pixel belongs to the skin region, the pixel is assigned with x, and if the pixel does not belong to the skin region, the pixel is assigned with y, thereby obtaining the first binary image.
  10. 根据权利要求6或8所述的装置,其特征在于,所述二值图获取模块,所述二值图获取模块,进一步还用于:The device according to claim 6 or 8, wherein the binary image obtaining module, the binary image obtaining module, is further configured to:
    计算所述像素点在皮肤混合高斯模型下的第一概率密度以及所述像素点在非皮肤混合高斯模型下的第二概率密度;Calculating a first probability density of the pixel point under a skin-mixed Gaussian model and a second probability density of the pixel point under a non-skin mixed Gaussian model;
    根据所述像素点的所述第一概率密度和所述第二概率密度计算所述像素点属于皮肤区域的后验概率;Calculating a posterior probability that the pixel belongs to a skin region according to the first probability density of the pixel point and the second probability density;
    当判定所述后验概率大于预设的后验概率阈值时,将所述像素点归属于皮肤区域;When the posterior probability is determined to be greater than a preset posterior probability threshold, the pixel point is attributed to the skin region;
    若所述像素点属于皮肤区域,则以x为所述像素点赋值,若所述像素点不属于皮肤区域,则以y为所述像素点赋值,从而得到所述第一二值图像和所述第二二值图像。If the pixel belongs to the skin region, the pixel is assigned with x, and if the pixel does not belong to the skin region, the pixel is assigned with y, thereby obtaining the first binary image and the The second binary image is described.
  11. 一种非暂态计算机可读存储介质,其特征在于,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行权利要求1-5任一所述方法。A non-transitory computer readable storage medium, wherein the non-transitory computer readable storage medium stores computer instructions for causing the computer to perform the method of any of claims 1-5 .
  12. 一种电子设备,其特征在于,包括:An electronic device, comprising:
    一个或多个处理器;以及,One or more processors; and,
    与所述一个或多个处理器通信连接的存储器;其中, a memory communicatively coupled to the one or more processors; wherein
    所述存储器存储有可被所述一个或多个处理器执行的指令,所述指令被所述一个或多个处理器执行,以使所述一个或多个处理器能够:The memory stores instructions executable by the one or more processors, the instructions being executed by the one or more processors to enable the one or more processors to:
    将获取到的待检测图像从RGB颜色空间转换到HSV颜色空间以获取HSV图像,并将所述待检测图像从RGB颜色空间转换到r-g颜色空间以获取r-g图像;Converting the acquired image to be detected from the RGB color space to the HSV color space to obtain an HSV image, and converting the image to be detected from the RGB color space to the r-g color space to obtain an r-g image;
    遍历读取所述HSV图像中的每一像素点,并根据预先建立的HSV直方图模型将所述HSV图像转化为第一二值图像,并遍历读取所述r-g图像中的每一像素点,根据预先建立的混合高斯模型将所述r-g图像转化为第二二值图像;Traversing each pixel in the HSV image and converting the HSV image into a first binary image according to a pre-established HSV histogram model, and traversing each pixel in the rg image Converting the rg image into a second binary image according to a pre-established mixed Gaussian model;
    对所述第一二值图像和所述第二二值图像进行按位与运算从而获得综合二值图像;Performing a bitwise AND operation on the first binary image and the second binary image to obtain a comprehensive binary image;
    对所述综合二值图像进行滤波以获取优化后的二值图像;Filtering the integrated binary image to obtain an optimized binary image;
    分析所述优化后的二值图像中最大的连通区域,将所述最大的连通区域作为皮肤区域;Analyzing a maximum connected area in the optimized binary image, and using the largest connected area as a skin area;
    使用预先训练的K近邻分类器判断所述最大的连通区域是否为手形,从而实现人手的识别。The pre-trained K-nearest neighbor classifier is used to determine whether the largest connected area is a hand shape, thereby realizing human hand recognition.
  13. 一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行权利要求1-5所述的方法。 A computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions that, when executed by a computer, cause the computer to execute The method of claims 1-5.
PCT/CN2016/096982 2015-12-01 2016-08-26 Human hand detection method and device based on skin colour WO2017092431A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510870145.1 2015-12-01
CN201510870145.1A CN105893925A (en) 2015-12-01 2015-12-01 Human hand detection method based on complexion and device

Publications (1)

Publication Number Publication Date
WO2017092431A1 true WO2017092431A1 (en) 2017-06-08

Family

ID=57002958

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/096982 WO2017092431A1 (en) 2015-12-01 2016-08-26 Human hand detection method and device based on skin colour

Country Status (2)

Country Link
CN (1) CN105893925A (en)
WO (1) WO2017092431A1 (en)

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107563272A (en) * 2017-06-14 2018-01-09 南京理工大学 Target matching method in a kind of non-overlapping visual field monitoring system
CN109583331A (en) * 2018-11-15 2019-04-05 复旦大学 Human wrist arteries and veins mouth position precise positioning method based on deep learning
CN109784357A (en) * 2018-11-19 2019-05-21 西安理工大学 A kind of image based on statistical model retakes detection method
CN109977734A (en) * 2017-12-28 2019-07-05 华为技术有限公司 Image processing method and device
CN110232690A (en) * 2019-06-05 2019-09-13 广东工业大学 A kind of method of image segmentation, system, equipment and computer readable storage medium
CN110473191A (en) * 2019-08-09 2019-11-19 深圳市三宝创新智能有限公司 A kind of erythema recognition methods
CN110473177A (en) * 2019-07-30 2019-11-19 上海媚测信息科技有限公司 Skin pigment distribution forecasting method, image processing system and storage medium
CN110619637A (en) * 2019-08-16 2019-12-27 上海吉汭泰网络科技有限公司 Template-based clothing image multi-feature statistical segmentation method
CN110728286A (en) * 2019-09-24 2020-01-24 西安理工大学 Abrasive belt grinding material removal rate identification method based on spark image
CN111079637A (en) * 2019-12-12 2020-04-28 武汉轻工大学 Method, device and equipment for segmenting rape flowers in field image and storage medium
CN111242052A (en) * 2020-01-16 2020-06-05 成都唐源电气股份有限公司 Method and device for automatically distinguishing rigid and flexible wires of contact network
CN111325728A (en) * 2020-02-19 2020-06-23 南方科技大学 Product defect detection method, device, equipment and storage medium
CN111429535A (en) * 2020-03-13 2020-07-17 深圳市雄帝科技股份有限公司 Method, system, device and medium for evaluating difference degree between clothes and background in image
CN111445466A (en) * 2020-04-01 2020-07-24 济南浪潮高新科技投资发展有限公司 Bolt anti-screwing-leakage detection method and device and medium
CN111754486A (en) * 2020-06-24 2020-10-09 北京百度网讯科技有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN111881789A (en) * 2020-07-14 2020-11-03 深圳数联天下智能科技有限公司 Skin color identification method and device, computing equipment and computer storage medium
CN112150438A (en) * 2020-09-23 2020-12-29 创新奇智(青岛)科技有限公司 Disconnection detection method, disconnection detection device, electronic device and storage medium
CN112446865A (en) * 2020-11-25 2021-03-05 创新奇智(广州)科技有限公司 Flaw identification method, flaw identification device, flaw identification equipment and storage medium
CN113361483A (en) * 2021-07-07 2021-09-07 合肥英睿系统技术有限公司 Traffic speed limit sign detection method, device, equipment and storage medium
CN113812965A (en) * 2021-08-19 2021-12-21 杭州回车电子科技有限公司 Sleep state recognition method, device, electronic device and storage medium
CN116503404A (en) * 2023-06-27 2023-07-28 梁山县创新工艺品股份有限公司 Plastic toy quality detection method and device, electronic equipment and storage medium
CN117437217A (en) * 2023-12-18 2024-01-23 武汉博源新材料科技集团股份有限公司 Paper-plastic product sorting method and system based on image recognition
CN117522863A (en) * 2023-12-29 2024-02-06 临沂天耀箱包有限公司 Integrated box body quality detection method based on image features

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105893925A (en) * 2015-12-01 2016-08-24 乐视致新电子科技(天津)有限公司 Human hand detection method based on complexion and device
CN106599771B (en) * 2016-10-21 2019-11-22 上海未来伙伴机器人有限公司 A kind of recognition methods and system of images of gestures
CN107239727A (en) * 2016-12-07 2017-10-10 北京深鉴智能科技有限公司 Gesture identification method and system
CN109857244B (en) * 2017-11-30 2023-09-01 百度在线网络技术(北京)有限公司 Gesture recognition method and device, terminal equipment, storage medium and VR glasses
CN108121971B (en) * 2017-12-25 2018-10-26 哈尔滨拓讯科技有限公司 A kind of human hand detection method and device based on action sequence feature
CN108596237B (en) * 2018-04-19 2019-11-15 北京邮电大学 A kind of endoscopic polyp of colon sorter of LCI laser based on color and blood vessel
CN109002825A (en) * 2018-08-07 2018-12-14 成都睿码科技有限责任公司 Hand bandage for dressing detection method based on video analysis
CN109299730B (en) * 2018-08-27 2022-03-04 鲁东大学 Method and device for establishing classification model of target detection and target detection equipment
CN110991458B (en) * 2019-11-25 2023-05-23 创新奇智(北京)科技有限公司 Image feature-based artificial intelligent recognition result sampling system and sampling method
CN111242936A (en) * 2020-01-17 2020-06-05 苏州瓴图智能科技有限公司 Non-contact palm herpes detection device and method based on image
CN111339315B (en) * 2020-02-21 2023-05-02 南京星火技术有限公司 Knowledge graph construction method, system, computer readable medium and electronic equipment
CN112734767A (en) * 2020-12-28 2021-04-30 平安科技(深圳)有限公司 Pathological image tissue region based extraction method, device, equipment and medium
CN113128435B (en) * 2021-04-27 2022-11-22 南昌虚拟现实研究院股份有限公司 Hand region segmentation method, device, medium and computer equipment in image
CN113240712A (en) * 2021-05-11 2021-08-10 西北工业大学 Underwater cluster neighbor tracking measurement method based on vision
CN113436097B (en) * 2021-06-24 2022-08-02 湖南快乐阳光互动娱乐传媒有限公司 Video matting method, device, storage medium and equipment
CN113744263B (en) * 2021-09-17 2023-10-27 景德镇陶瓷大学 Method for rapidly detecting surface defects of small-size mosaic ceramic

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090169099A1 (en) * 2007-12-05 2009-07-02 Vestel Elektronik Sanayi Ve Ticaret A.S. Method of and apparatus for detecting and adjusting colour values of skin tone pixels
CN103106386A (en) * 2011-11-10 2013-05-15 华为技术有限公司 Dynamic self-adaption skin color segmentation method and device
CN103745193A (en) * 2013-12-17 2014-04-23 小米科技有限责任公司 Skin color detection method and skin color detection device
US20140147035A1 (en) * 2011-04-11 2014-05-29 Dayaong Ding Hand gesture recognition system
US20140177955A1 (en) * 2012-12-21 2014-06-26 Sadagopan Srinivasan System and method for adaptive skin tone detection
CN105893925A (en) * 2015-12-01 2016-08-24 乐视致新电子科技(天津)有限公司 Human hand detection method based on complexion and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101251898B (en) * 2008-03-25 2010-09-15 腾讯科技(深圳)有限公司 Skin color detection method and apparatus
CN102968623B (en) * 2012-12-07 2015-12-23 上海电机学院 Face Detection system and method
CN104318558B (en) * 2014-10-17 2017-06-23 浙江大学 Hand Gesture Segmentation method based on Multi-information acquisition under complex scene

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090169099A1 (en) * 2007-12-05 2009-07-02 Vestel Elektronik Sanayi Ve Ticaret A.S. Method of and apparatus for detecting and adjusting colour values of skin tone pixels
US20140147035A1 (en) * 2011-04-11 2014-05-29 Dayaong Ding Hand gesture recognition system
CN103106386A (en) * 2011-11-10 2013-05-15 华为技术有限公司 Dynamic self-adaption skin color segmentation method and device
US20140177955A1 (en) * 2012-12-21 2014-06-26 Sadagopan Srinivasan System and method for adaptive skin tone detection
CN103745193A (en) * 2013-12-17 2014-04-23 小米科技有限责任公司 Skin color detection method and skin color detection device
CN105893925A (en) * 2015-12-01 2016-08-24 乐视致新电子科技(天津)有限公司 Human hand detection method based on complexion and device

Cited By (40)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107563272A (en) * 2017-06-14 2018-01-09 南京理工大学 Target matching method in a kind of non-overlapping visual field monitoring system
CN107563272B (en) * 2017-06-14 2023-06-20 南京理工大学 Target matching method in non-overlapping vision monitoring system
CN109977734A (en) * 2017-12-28 2019-07-05 华为技术有限公司 Image processing method and device
CN109977734B (en) * 2017-12-28 2023-06-06 华为技术有限公司 Image processing method and device
CN109583331A (en) * 2018-11-15 2019-04-05 复旦大学 Human wrist arteries and veins mouth position precise positioning method based on deep learning
CN109583331B (en) * 2018-11-15 2023-05-02 复旦大学 Deep learning-based accurate positioning method for positions of wrist vein and mouth of person
CN109784357A (en) * 2018-11-19 2019-05-21 西安理工大学 A kind of image based on statistical model retakes detection method
CN109784357B (en) * 2018-11-19 2022-10-11 西安理工大学 Image rephotography detection method based on statistical model
CN110232690A (en) * 2019-06-05 2019-09-13 广东工业大学 A kind of method of image segmentation, system, equipment and computer readable storage medium
CN110473177A (en) * 2019-07-30 2019-11-19 上海媚测信息科技有限公司 Skin pigment distribution forecasting method, image processing system and storage medium
CN110473177B (en) * 2019-07-30 2022-12-09 上海媚测信息科技有限公司 Skin pigment distribution prediction method, image processing system, and storage medium
CN110473191A (en) * 2019-08-09 2019-11-19 深圳市三宝创新智能有限公司 A kind of erythema recognition methods
CN110619637A (en) * 2019-08-16 2019-12-27 上海吉汭泰网络科技有限公司 Template-based clothing image multi-feature statistical segmentation method
CN110728286A (en) * 2019-09-24 2020-01-24 西安理工大学 Abrasive belt grinding material removal rate identification method based on spark image
CN110728286B (en) * 2019-09-24 2023-02-10 西安理工大学 Abrasive belt grinding material removal rate identification method based on spark image
CN111079637A (en) * 2019-12-12 2020-04-28 武汉轻工大学 Method, device and equipment for segmenting rape flowers in field image and storage medium
CN111079637B (en) * 2019-12-12 2023-09-08 武汉轻工大学 Method, device, equipment and storage medium for segmenting rape flowers in field image
CN111242052A (en) * 2020-01-16 2020-06-05 成都唐源电气股份有限公司 Method and device for automatically distinguishing rigid and flexible wires of contact network
CN111242052B (en) * 2020-01-16 2023-08-08 成都唐源电气股份有限公司 Automatic distinguishing method and device for rigid-flexible wires of contact net
CN111325728B (en) * 2020-02-19 2023-05-30 南方科技大学 Product defect detection method, device, equipment and storage medium
CN111325728A (en) * 2020-02-19 2020-06-23 南方科技大学 Product defect detection method, device, equipment and storage medium
CN111429535B (en) * 2020-03-13 2023-09-08 深圳市雄帝科技股份有限公司 Method, system, equipment and medium for evaluating difference degree between clothes and background in image
CN111429535A (en) * 2020-03-13 2020-07-17 深圳市雄帝科技股份有限公司 Method, system, device and medium for evaluating difference degree between clothes and background in image
CN111445466B (en) * 2020-04-01 2023-05-05 山东浪潮科学研究院有限公司 Bolt anti-leakage screwing detection method, equipment and medium
CN111445466A (en) * 2020-04-01 2020-07-24 济南浪潮高新科技投资发展有限公司 Bolt anti-screwing-leakage detection method and device and medium
CN111754486A (en) * 2020-06-24 2020-10-09 北京百度网讯科技有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN111754486B (en) * 2020-06-24 2023-08-15 北京百度网讯科技有限公司 Image processing method, device, electronic equipment and storage medium
CN111881789A (en) * 2020-07-14 2020-11-03 深圳数联天下智能科技有限公司 Skin color identification method and device, computing equipment and computer storage medium
CN112150438B (en) * 2020-09-23 2023-01-20 创新奇智(青岛)科技有限公司 Disconnection detection method, disconnection detection device, electronic device and storage medium
CN112150438A (en) * 2020-09-23 2020-12-29 创新奇智(青岛)科技有限公司 Disconnection detection method, disconnection detection device, electronic device and storage medium
CN112446865A (en) * 2020-11-25 2021-03-05 创新奇智(广州)科技有限公司 Flaw identification method, flaw identification device, flaw identification equipment and storage medium
CN113361483A (en) * 2021-07-07 2021-09-07 合肥英睿系统技术有限公司 Traffic speed limit sign detection method, device, equipment and storage medium
CN113812965A (en) * 2021-08-19 2021-12-21 杭州回车电子科技有限公司 Sleep state recognition method, device, electronic device and storage medium
CN113812965B (en) * 2021-08-19 2024-04-09 杭州回车电子科技有限公司 Sleep state identification method, sleep state identification device, electronic device and storage medium
CN116503404A (en) * 2023-06-27 2023-07-28 梁山县创新工艺品股份有限公司 Plastic toy quality detection method and device, electronic equipment and storage medium
CN116503404B (en) * 2023-06-27 2023-09-01 梁山县创新工艺品股份有限公司 Plastic toy quality detection method and device, electronic equipment and storage medium
CN117437217A (en) * 2023-12-18 2024-01-23 武汉博源新材料科技集团股份有限公司 Paper-plastic product sorting method and system based on image recognition
CN117437217B (en) * 2023-12-18 2024-03-08 武汉博源新材料科技集团股份有限公司 Paper-plastic product sorting method and system based on image recognition
CN117522863A (en) * 2023-12-29 2024-02-06 临沂天耀箱包有限公司 Integrated box body quality detection method based on image features
CN117522863B (en) * 2023-12-29 2024-03-29 临沂天耀箱包有限公司 Integrated box body quality detection method based on image features

Also Published As

Publication number Publication date
CN105893925A (en) 2016-08-24

Similar Documents

Publication Publication Date Title
WO2017092431A1 (en) Human hand detection method and device based on skin colour
WO2020207423A1 (en) Skin type detection method, skin type grade classification method and skin type detection apparatus
US10372226B2 (en) Visual language for human computer interfaces
CN111488756B (en) Face recognition-based living body detection method, electronic device, and storage medium
WO2017088365A1 (en) Skin-colour detection method and apparatus
KR102449841B1 (en) Method and apparatus for detecting target
WO2019100282A1 (en) Face skin color recognition method, device and intelligent terminal
Ajmal et al. A comparison of RGB and HSV colour spaces for visual attention models
CN106023257B (en) A kind of method for tracking target based on rotor wing unmanned aerial vehicle platform
WO2019114036A1 (en) Face detection method and device, computer device, and computer readable storage medium
CN107507144B (en) Skin color enhancement processing method and device and image processing device
CN108090511B (en) Image classification method and device, electronic equipment and readable storage medium
CN104268590B (en) The blind image quality evaluating method returned based on complementary combination feature and multiphase
CN109308711A (en) Object detection method, device and image processing equipment
CN107506738A (en) Feature extracting method, image-recognizing method, device and electronic equipment
CN111709305A (en) Face age identification method based on local image block
KR101334794B1 (en) Flower recognition method and apparatus using feature extraction
KR101344851B1 (en) Device and Method for Processing Image
JP5615344B2 (en) Method and apparatus for extracting color features
CN107862681B (en) Self-timer image quality recommendation method
CN110310341A (en) The generation method of default parameters, device, equipment and storage medium in color algorithm
CN106402717B (en) A kind of AR control method for playing back and intelligent desk lamp
KR100488014B1 (en) YCrCb color based human face location detection method
CN109141457A (en) Navigate appraisal procedure, device, computer equipment and storage medium
Shemshaki et al. Lip segmentation using geometrical model of color distribution

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: 16869742

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: 16869742

Country of ref document: EP

Kind code of ref document: A1