[0019] The present invention proposes a method for improving the illumination preprocessing of a face image. By introducing the improved LBP operator and the Hamming distance error correction method into the illumination preprocessing method, the face image is subjected to illumination preprocessing. The pretreatment process of the present invention is as figure 2 Shown. The method is implemented under the support of a computer equipped with digital image processing software. The software includes the preprocessing of the image with the LBP algorithm, including the collection, classification, encoding, storage and correction of the digital image related information. The division of the intermediate data storage area and the operation of the data, call the matching graphics processing software program, calculate the gray value M of each pixel of the graphic and the pixels on the surrounding neighborhood, and output a complete image according to the gray value M Elephant. With the support of computer hardware and related software programs, the lighting preprocessing process includes the following steps:
[0020] 1) With the support of the computer and its image management software, the data set of the gray value V of each pixel of the image is obtained, and the data of the gray arithmetic mean value M of each pixel and 8 pixels in the surrounding area is obtained. Set, respectively encode and transfer to the designated area in the intermediate register, set the value range of the adjustment coefficient α as: 1≤α≤2, respectively call the M value corresponding to each pixel in the intermediate memory according to M× α=M is re-assigned after the operation, and then the re-assigned M is compared with the original pixel gray value V of the corresponding pixel. When the pixel gray value V is less than M×(2-α), the The corresponding threshold T is set to M×(2-α). When the pixel gray value V is greater than M×(2-α) but less than M×α, the corresponding threshold T is set to V, and the adjusted threshold T Stored in a specific area of the intermediate storage.
[0021] 2) Encode and classify each pixel point of the acquired face image according to coordinates and gray value. Those with the same gray level are divided into one category. For points with clear boundaries in the image, the gray value remains unchanged, and find out The "white spot" point in the image with a gray value of 255 is marked as V (X,Y)255 , Ready to be repaired,
[0022] 3) For frontal and non-frontal face images, symmetric restoration and nearest neighbor replacement methods are used to obtain the corrected gray value of the "white spot" point. The specific steps are:
[0023] Refer to the V set in the intermediate storage unit for the code value of the pixel in the "white spot" area with the marker (x,y)255 Perform comparison and adjustment, and replace the gray value of the "white spot" pixel with the gray value of the symmetrical pixel with respect to the center line of the face image relative to the "white spot" pixel. For the pixels in the non-front face image, A method of replacing the coded gray value of the non-mutation pixel adjacent to the "white spot" pixel is used, and the adjusted data is stored in the intermediate memory. The specific process is: For a face image with a size of H×W, the CPU calls related programs to undergo threshold adjustment and LBP 8,1 After the operator is processed, if the result is V 8,1 (x, y) satisfies the conditions:
[0024] V 8,1 (x, y)=255 0≤x
[0025] Call it the LBP code of a "white spot" component point, and mark it as V 8,1 (x, y) 255 , Put it in the memory, for the frontal face image, through the matching graphics processing software program, adopt the method of symmetry repair to adjust the value of the code, the specific method can be described by the following formula:
[0026] V 8,1 ( x , y ) 255 = V 8,1 ( x , W - y - 1 ) , if V 8,1 ( x , W - y - 1 ) ≠ 255 V 8,1 ( x , y - 1 ) , if V 8,1 ( x , W - y - 1 ) = 255 andy 0 V 8,1 ( x - 1 , y ) , if V 8,1 ( x - 1 , y ) = 255 andy = 0 andx = 0 255 if V 8,1 ( x , W - y - 1 ) = 255 andy = 0 angx = 0 - - - ( 2 )
[0027] Since "white spots" generally appear in areas with large areas and similar textures on the forehead and cheeks, formula (2) is still applicable for quasi-frontal face images. For non-frontal face images, the computer program uses the nearest neighbor substitution method, which can be described by the following formula:
[0028] V 8,1 ( x , y ) 255 = V 8,1 ( x , y - 1 ) if y 0 V 8,1 ( x - 1 , y ) if y = 0 and x 0 255 if y = 0 and x = 0 - - - ( 3 )
[0029] Use the above method to adjust the fusion LBP code of the "white spot" component points, and put the adjusted result into the intermediate memory.
[0030]4) Further adjustments are carried out according to the prediction mode status of the pixel points. With the help of image processing software, the mode types of the 8 pixel points in the surrounding neighborhood of the pixel to be adjusted are counted, and the number of non-uniform patterns in the neighborhood is calculated. When the number is not greater than 3, the pixel to be adjusted is considered to be a unified mode, and when the number of non-uniform patterns in the neighborhood is not less than 7, the pixel to be adjusted is considered to be a non-uniform mode, and the remaining states are considered Uncertain mode, put its prediction result into intermediate storage,
[0031] 5) Compare the prediction mode type with the actual mode type: for the case where the prediction mode type is uncertain, keep the coding value of the central pixel unchanged without transformation, for the case where the prediction mode is determined, adjust according to the predicted The mode type of the pixel point is subjected to bidirectional mode conversion to form a new pixel point data set, and the result is output. The specific method of the two-way mode conversion is: if the prediction mode type of the pixel to be adjusted is consistent with the actual mode type, then the encoding value of the pixel to be adjusted is kept unchanged; if the prediction mode type of the pixel is to be adjusted to its actual mode If the types are inconsistent, the code value of the pixel to be adjusted is considered to be an error code caused by "noise" interference, and the code value of the pixel to be adjusted is transformed into the same mode as the prediction mode type according to the principle of minimum Hamming distance . Obviously, the transformation performed by the computer using this method is bidirectional. Compared with the original Hamming distance constraint method, it not only saves part of the information of the non-uniform mode, but also corrects some errors caused by the "noise" interference. Encoding error in the case of unified mode.
[0032] From image 3 It can be seen from the comparison of the first row and the second row of images that the method proposed by the present invention makes the contour of the face image clearer and has very good robustness to changes in illumination.