Method and apparatus for detecting glasses in a face image
First Claim
Patent Images
1. A method for detecting glasses in a face image performed at a computing device having one or more processors and memory storing one or more programs to be executed by the one or more processors, the method comprising:
- obtaining a face image;
determining a nose bridge region, a left eye, and a right eye in the face image;
detecting an image change in the nose bridge region to obtain an image change result of the nose bridge region, wherein the image change is a gradient change in a gray scale of a pixel in the face image, further comprising;
designating first coordinates corresponding to a right corner of the left eye as L(x1, y1);
designating second coordinates corresponding to a left corner of the right eye as R(x2, y2);
determining a length of the nose bridge region by taking a difference between the horizontal components of the first and second coordinates;
determining a width of the nose bridge region based on a width of the eyes;
designating the width of the nose bridge region as n pixels, wherein n is an integer;
computing a vertical gradient per pixel, wi, along the width of the nose bridge region to obtain a gradient vector w in the length of n, wherein i is an integer having values from one to n and w={w1, w2, . . . , wn};
computing an average gradient value, u, of the gradient vector w, wherein
1 Assignment
0 Petitions
Accused Products
Abstract
This application discloses a method and a terminal for detecting glasses in a face image. The method includes: obtaining a face image; determining a nose bridge region in the face image; detecting an image change in the nose bridge region to obtain an image change result of the nose bridge region; and determining whether there are glasses in the face image according to the image change result of the nose bridge region. The terminal for detecting glasses in a face image matches the method.
-
Citations
9 Claims
-
1. A method for detecting glasses in a face image performed at a computing device having one or more processors and memory storing one or more programs to be executed by the one or more processors, the method comprising:
-
obtaining a face image; determining a nose bridge region, a left eye, and a right eye in the face image; detecting an image change in the nose bridge region to obtain an image change result of the nose bridge region, wherein the image change is a gradient change in a gray scale of a pixel in the face image, further comprising; designating first coordinates corresponding to a right corner of the left eye as L(x1, y1); designating second coordinates corresponding to a left corner of the right eye as R(x2, y2); determining a length of the nose bridge region by taking a difference between the horizontal components of the first and second coordinates; determining a width of the nose bridge region based on a width of the eyes; designating the width of the nose bridge region as n pixels, wherein n is an integer; computing a vertical gradient per pixel, wi, along the width of the nose bridge region to obtain a gradient vector w in the length of n, wherein i is an integer having values from one to n and w={w1, w2, . . . , wn}; computing an average gradient value, u, of the gradient vector w, wherein - View Dependent Claims (2, 3)
-
-
4. A terminal for detecting glasses in a face image, comprising:
-
one or more processors; memory; and a plurality of programs stored in the memory, wherein the plurality of programs, when executed by the one or more processors, cause the terminal to perform a plurality of operations including; obtaining a face image; determining a nose bridge region, a left eye, and a right eye in the face image; detecting an image change in the nose bridge region to obtain an image change result of the nose bridge region, wherein the image change is a gradient change in a gray scale of a pixel in the face image, further comprising; designating first coordinates corresponding to a right corner of the left eye as L(x1, y1); designating second coordinates corresponding to a left corner of the right eye as R(x2, y2); determining a length of the nose bridge region by taking a difference between the horizontal components of the first and second coordinates; determining a width of the nose bridge region based on a width of the eyes; designating the width of the nose bridge region as n pixels, wherein n is an integer; computing a vertical gradient per pixel, wi, along the width of the nose bridge region to obtain a gradient vector w in the length of n, wherein i is an integer having values from one to n and w={w1, w2, . . . , wn}; computing an average gradient value, u, of the gradient vector w, wherein - View Dependent Claims (5, 6)
-
-
7. A non-transitory computer storage medium in connection with a terminal having one or more processors, storing a plurality of programs, wherein the plurality of programs, when executed by the one or more processors, cause the terminal to perform a plurality of operations including:
-
obtaining a face image; determining a nose bridge region, a left eye, and a right eye in the face image; detecting an image change in the nose bridge region to obtain an image change result of the nose bridge region, wherein the image change is a gradient change in a gray scale of a pixel in the face image, further comprising; designating first coordinates corresponding to a right corner of the left eye as L(x1, y1); designating second coordinates corresponding to a left corner of the right eye as R(x2, y2); determining a length of the nose bridge region by taking a difference between the horizontal components of the first and second coordinates; determining a width of the nose bridge region based on a width of the eyes; designating the width of the nose bridge region as n pixels, wherein n is an integer; computing a vertical gradient per pixel, wi, along the width of the nose bridge region to obtain a gradient vector w in the length of n, wherein i is an integer having values from one to n and w={w1, w2, . . . , wn}; computing an average gradient value, u, of the gradient vector w, wherein - View Dependent Claims (8, 9)
-
Specification